feat(api): integrated /cart and /order api's

This commit is contained in:
Azmat Ali
2026-03-09 15:23:32 +05:30
parent ea0835b564
commit c7549b1009
5 changed files with 138 additions and 2 deletions
+27
View File
@@ -0,0 +1,27 @@
export async function handler(event) {
const API = process.env.API_BASE_URL;
try {
const res = await fetch(`${API}/order`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: event.body,
});
console.log(res);
const data = await res.text();
return {
statusCode: res.status,
body: data,
};
} catch (err) {
return {
statusCode: 500,
body: JSON.stringify({ error: "Order API failed" }),
};
}
}