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

hello there 


Could you please reach out to us at support@judge.me and we'll check the request further with you ?


Waiting for your email!


Kind regards!

Login or Signup to post a comment