payload-validation #30

Merged
y merged 2 commits from payload-validation into staging 2025-04-02 09:47:26 +00:00
Showing only changes of commit 14b61fa0f3 - Show all commits

@ -37,11 +37,11 @@ reviewsRouter.post('/', async (req: Request, res: Response) => {
throw error.details[0].message
}
const reviews = await collections.reviews?.findOne({
const existingReview = await collections.reviews?.findOne({
eventId: review.eventId
})
if (reviews) {
if (existingReview) {
throw new Error('review with provided "eventId" exists')
}