async function addToCartRequest()

in app/static/utilities.js [21:39]


async function addToCartRequest(id, update, restore) {
  try {
    await fetch(addToCartURL, {
      method: "POST",
      mode: "same-origin",
      cache: "no-cache",
      headers: {
          "Content-Type": "application/x-www-form-urlencoded",
      },
      redirect: "error",
      referrer: "no-referrer",
      body: `id=${id}`
    })
    update();
  } catch (error) {
    console.log(error);
    restore();
  }
}