Conversations about creating, managing, and using metafields to store and retrieve custom data for apps and themes.
I'm making a POST request in my dev shop:
//data const metafieldInput = {¬ "metafield": {¬ "namespace": "customProductMetafields",¬ "key": "productDetails",¬ "value": detail,¬ "value_type": "json_string"¬ }¬ };¬ //request axios.post( '/admin/metafields.json', {¬ metafieldInput¬ })¬ .then(function (response) {¬ console.log(response);¬ })¬ .catch(function (error) {¬ console.log(error);¬ });
Yet the shopOrigin forceRedirect doesn't seem to be working, or I don't have it applied properly, because the request is sent to 123.ngrok.io and not store.myshopify.com.
This is a development store with a public app. The setup was followed from the Create a Shopify App with React and Node provided by Shopify.
Solved! Go to the solution
This is an accepted solution.
Hey @jenn11,
Force redirect detects if your app was loaded inside an iframe. If not, it will create a redirection back into the relative embedded URL in the Shopify admin.
To post the request to the myshopify url, you'll need to add the Shop to the URL like this.
Scott | Developer Advocate @ Shopify
bumping as I'm still stumped on this.
This is an accepted solution.
Hey @jenn11,
Force redirect detects if your app was loaded inside an iframe. If not, it will create a redirection back into the relative embedded URL in the Shopify admin.
To post the request to the myshopify url, you'll need to add the Shop to the URL like this.
Scott | Developer Advocate @ Shopify
Apologies for the delayed acceptance, I was learning out your answer 🙂