From 3489b75ec20318c9782173a8d42fc0dcd31f4624 Mon Sep 17 00:00:00 2001 From: Naval Date: Wed, 5 Mar 2025 12:17:56 +0530 Subject: [PATCH] TEMP: CORS issue fix Signed-off-by: Naval --- src/components/panel/PhoneNumberList.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/panel/PhoneNumberList.tsx b/src/components/panel/PhoneNumberList.tsx index ab4d1a0..3c8ae11 100644 --- a/src/components/panel/PhoneNumberList.tsx +++ b/src/components/panel/PhoneNumberList.tsx @@ -36,7 +36,7 @@ export function PhoneNumberList() { const fetchNumberList = async () => { try { const myHeaders = new Headers({ - "Origin": window.location.origin, + "Origin": "*", "x-requested-with": "XMLHttpRequest" }); @@ -45,9 +45,10 @@ export function PhoneNumberList() { headers: myHeaders }; - const corsProxy = "https://cors-anywhere.herokuapp.com/"; - const apiUrl = "https://api.sms-activate.ae/stubs/handler_api.php?api_key=eA103094961490b3350620b1bdd57244&action=getActiveActivations"; - const response = await fetch(corsProxy + apiUrl, requestOptions) + // const corsProxy = "https://cors-anywhere.herokuapp.com/"; + // const apiUrl = "https://api.sms-activate.ae/stubs/handler_api.php?api_key=eA103094961490b3350620b1bdd57244&action=getActiveActivations"; + // const response = await fetch(corsProxy + apiUrl, requestOptions) + const response= await fetch("https://ikmbnngahzcellthaysf.supabase.co/functions/v1/call-sms-gateway", requestOptions) const data = await response.json() console.log(data) setNumberList(data?.activeActivations || [])