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,35 @@
const { removeWishlistEntry } = require("../lib/bigcommerceRestAPI.js")
const { withAccount } = require("../lib/utils")
const { createWishlistEntry } = require("../lib/bigcommerceRestAPI.js")
;(function () {
withAccount((login) => {
const productId = context.data.productId
const variantId = context.data.variantId
const customerId = login.bigCommerceId
if (context.data.delete) {
if (!productId || !variantId) {
throw {
message: "Invalid product or variant id",
code: 400,
}
}
const wishlist = removeWishlistEntry(customerId, productId, variantId)
throw {
status: 200,
data: wishlist,
}
}
if (!productId || !variantId) {
throw {
message: "Invalid product or variant id",
code: 400,
}
}
const wishlist = createWishlistEntry(productId, variantId, customerId)
throw {
status: 200,
data: wishlist,
}
})
})()