How do you handle deleting resources?

Highlighted
Tourist
15 0 2

I am building an app that saves resources for customers in a remote database. I need them to be able to delete these on the storefront, but it seems that Shopify only allows GET and POST requests through app proxy. When I try to use the DELETE method, the shop just goes in a redirect loop to the password page. I imagine I can just make a route that accepts a POST and deletes it, but before I hack something like that together, is there a better way to do this? I'm using the Shopify Rails library if that makes any difference.

0 Likes
Highlighted
Tourist
15 0 2

Figured this one out, apparently having the store password protected blocks the DELETE method. Once I turned off password protect everything worked.

0 Likes
Highlighted
Shopify Expert
9925 103 1764

I know you said you figured this out but how are you making the calls in the first place that would see hte storefront password be a problem? Are you making the API call via the front end code vs authenticated app? Just wanted to double check here in case you're doing something crazy.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
1 Like
Highlighted
Tourist
15 0 2

Yea, basically it's just a React js front-end that makes a fetch call to the api from the storefront. The app I'm making doesn't use any of the Shopify endpoints after the initial install.

0 Likes
Highlighted
Tourist
24 0 1

I am attempting to DELETE products via Basic Authentication (making calls to the REST Admin API) and can confirm that the DELETE method will not work if there's a password on the storefront.

0 Likes
Highlighted
Shopify Expert
4175 29 400

I love that sly little note about checking for crazy.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes