integrated direct api calls
This commit is contained in:
@@ -58,7 +58,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
};
|
||||
|
||||
try {
|
||||
const res = await fetch(".netlify/functions/order", {
|
||||
const res = await fetch(`${CONFIG.API_BASE_URL}/order`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@@ -68,7 +68,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
|
||||
console.log(res);
|
||||
|
||||
if (!res.ok) throw new Error("Order failed");
|
||||
// if (!res.ok) throw new Error("Order failed");
|
||||
|
||||
// unlock payment QR
|
||||
qrWrapper.classList.remove("blurred");
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
window.CONFIG = {
|
||||
API_BASE_URL:
|
||||
"https://wzuty7bm2wjjijzpwjkljqlhri0wlzuv.lambda-url.eu-west-1.on.aws",
|
||||
};
|
||||
Reference in New Issue
Block a user