chore: fixed variable name
This commit is contained in:
parent
35b2cec312
commit
14b61fa0f3
@ -37,11 +37,11 @@ reviewsRouter.post('/', async (req: Request, res: Response) => {
|
|||||||
throw error.details[0].message
|
throw error.details[0].message
|
||||||
}
|
}
|
||||||
|
|
||||||
const reviews = await collections.reviews?.findOne({
|
const existingReview = await collections.reviews?.findOne({
|
||||||
eventId: review.eventId
|
eventId: review.eventId
|
||||||
})
|
})
|
||||||
|
|
||||||
if (reviews) {
|
if (existingReview) {
|
||||||
throw new Error('review with provided "eventId" exists')
|
throw new Error('review with provided "eventId" exists')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user