mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-04 15:07:13 +01:00
fix validation error
This commit is contained in:
committed by
Thomas Ruoff
parent
b92ff0e3d8
commit
ef4c8ce24a
@@ -47,7 +47,10 @@ export async function createBooking({
|
|||||||
|
|
||||||
if (booking.days.some((day: string) => bookedDays.includes(day))) {
|
if (booking.days.some((day: string) => bookedDays.includes(day))) {
|
||||||
const error = new mongoose.Error.ValidationError(booking)
|
const error = new mongoose.Error.ValidationError(booking)
|
||||||
error.addError('endDate', new mongoose.Error.ValidatorError())
|
error.addError(
|
||||||
|
'endDate',
|
||||||
|
new mongoose.Error.ValidatorError({ message: 'Schon gebucht' })
|
||||||
|
)
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user