Hey! I’m currently making the first steps with the Blocks SDK and having problems with fetching data from our Shopify Backend.
I’m trying to do it like this (frontend.js):
let url = https://xyz.myshopify.com/admin/api/2020-01/orders/${record.getCellValue("Shopify Id")}
let response = await fetch(url,{
method: ‘GET’,
headers: {
‘Content-Type’: ‘application/json’,
‘X-Shopify-Access-Token’: ‘xyz’,
},
})
return await response.json()
Whenever I trigger this function, the console logs say:
Access to fetch at 'https://xyz.myshopify.com/admin/api/2020-01/orders/123.json' from origin 'https://devblock---123xyz.airtableblocks.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.
Any help with this will be much appreciated :slightly_smiling_face: