mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-04 15:07:13 +01:00
fix type errors hopefully *fingerscrossed*
This commit is contained in:
13
db/index.ts
13
db/index.ts
@@ -72,14 +72,11 @@ export async function createBooking({
|
||||
bookedDays.includes(day)
|
||||
)
|
||||
if (doubleBookedDays.length) {
|
||||
const error = new mongoose.Error.ValidationError(booking)
|
||||
error.addError(
|
||||
'days',
|
||||
new mongoose.Error.ValidatorError({
|
||||
message: `${doubleBookedDays
|
||||
.map((dateString) => dateFormatFrontend(new Date(dateString)))
|
||||
.join(', ')} schon gebucht`,
|
||||
})
|
||||
const error = new mongoose.Error.ValidationError(booking.uuid)
|
||||
error.errors.days = new mongoose.Error.ValidatorError(
|
||||
`${doubleBookedDays
|
||||
.map((dateString) => dateFormatFrontend(new Date(dateString)))
|
||||
.join(', ')} schon gebucht`
|
||||
)
|
||||
throw error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user