Initial commit

This commit is contained in:
2025-10-02 08:54:03 +02:00
commit ea54638227
1642 changed files with 53677 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
const { addCartItem, updateCartItem, deleteCartItem, getCart } = require("../lib/bigcommerceRestAPI")
const { postAddToCart } = require("../lib/facebookRestAPI")
;(function () {
const operation = context?.data?.operation
if (operation == "add") {
addCartItem(context?.data?.cartId, context?.data?.lineItems)
try {
postAddToCart()
} catch (e) {}
} else if (operation == "update") {
updateCartItem(context?.data?.cartId, context?.data?.lineItem, context?.data?.entityId)
try {
postAddToCart()
} catch (e) {}
} else if (operation == "delete") {
deleteCartItem(context?.data?.cartId, context?.data?.entityId)
}
throw {
status: 200,
message: "success",
}
})()