I want to get the discount code present in my store in my checkout-extension so i am using fetch but its giving me cors error instead of giving true to network access.Also i enabled from the partners also.
useEffect(()=>{
fetch([https://tide-plus-store.myshopify.com/admin/api/2023-10/price_rules/discount_codes.json](https://tide-plus-store.myshopify.com/admin/api/2023-10/price_rules/discount_codes.json))
.then((cardDataRaw) => cardDataRaw.json())
.then((cardDataParsed) => {
console.log(cardDataParsed);
Error : Access to fetch at ‘https://tide-plus-store.myshopify.com/admin/api/2023-10/price_rules/discount_codes.json’ from origin ‘https://extensions.shopifycdn.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.