tibi-docs/api/hooks/rating/put_update.js
2024-03-11 17:26:10 +00:00

15 lines
387 B
JavaScript

;(function () {
if (!context?.user?.auth()?.id) {
console.log(context?.user?.auth()?.id)
//TODO: productInsideOrder(context.data) look in post
}
/** @type {ProductRating} */ // @ts-ignore
let ratingObj = context.db.find("rating", {
filter: {
_id: context.data.id,
},
})[0]
context["oldRating"] = ratingObj.rating
})()