How do you handle deleting resources?

David_W
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
David_W
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
Jason
Shopify Expert
10260 142 1940

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.

I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.


★ http://freakdesign.com.au ★
David_W
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
rsfxiii
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
HunkyBill
Shopify Expert
4476 45 484

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