The Same Origin Policy disallows reading the remote resource at https://judge.me/api/v1/reviews.


 i am using judge.me create review endpoint to create review iam using react fetch for this


image


i am getting this when i am trying to create review


export async function postreview({
  rid,
  productrating,
  reviewername,
  revieweremail,
  reviewtitle,
  comment,
}) {
  const domain = "inari-naturals.myshopify.com";
  const platform = "shopify";

  try {
    const data = await fetch(`https://judge.me/api/v1/reviews`, {
      method: "POST",
      crossDomain: true,
      mode:"cors",
      headers: {
        "Content-Type": "application/json",
        "Access-Control-Allow-Origin": "*",
      },
      body: JSON.stringify({
        shop_domain: domain,
        platform: platform,
        name: reviewername,
        email: revieweremail,
        rating: productrating,
        body: comment,
        id: rid,
        title: reviewtitle,
      }),
    }).then((response) => {
      return response.json();
    });

    return data;
  } catch (error) {
    console.log(error);
    throw new Error("review not submitted");
  }
}


this is how i am trying to create review


i tried it with postman but it works fine



can someone help me with this

1 Comment

Mujhe galat product aaya hain Maine dress dala tha aapne mujhe saree kyu bhiji mujhe samaj nhi aya hain plz refund me my many Mujhe contact karo 7059999797
Login or Signup to post a comment