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,17 @@
const { productInsideOrder } = require("../lib/utils")
;(function () {
if (!context?.user?.auth()?.id) {
if (!context.data) throw { status: 400, error: "No data provided" }
// @ts-ignore
productInsideOrder(context.data)
/** @type {ProductRating[]} */ // @ts-ignore
let ratings = context.db.find("rating", {
filter: {
bigcommerceOrderId: context?.data?.bigcommerceOrderId,
bigCommerceProductId: context?.data?.bigCommerceProductId,
},
})
if (ratings.length) throw { status: 400, error: "Rating already existing" }
}
})()