UNPKG

@wepublish/api

Version:
29 lines 907 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.userCommentRating = exports.getRatingSystem = void 0; const tslib_1 = require("tslib"); const getRatingSystem = (commentRatingSystem) => { return commentRatingSystem.findFirst({ include: { answers: true } }); }; exports.getRatingSystem = getRatingSystem; const userCommentRating = (commentId, optionalAuthenticateUser, commentRating) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { const session = optionalAuthenticateUser(); if (!session) { return []; } return yield commentRating.findMany({ where: { commentId, userId: session.user.id }, include: { answer: true } }); }); exports.userCommentRating = userCommentRating; //# sourceMappingURL=comment-rating.public-queries.js.map