tibi-docs/api/hooks/rating/put_update.js

15 lines
387 B
JavaScript
Raw Normal View History

2024-03-11 18:14:31 +01:00
;(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
})()