Allow '0' minimumBookingNotice

bugfix/availability-errors
Alex van Andel 2021-12-09 01:45:16 +01:00
parent df654e36a4
commit 637fe4d49c
1 changed files with 4 additions and 3 deletions

View File

@ -121,9 +121,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
periodStartDate: req.body.periodStartDate,
periodEndDate: req.body.periodEndDate,
periodCountCalendarDays: req.body.periodCountCalendarDays,
minimumBookingNotice: req.body.minimumBookingNotice
? parseInt(req.body.minimumBookingNotice)
: undefined,
minimumBookingNotice:
req.body.minimumBookingNotice || req.body.minimumBookingNotice == 0
? parseInt(req.body.minimumBookingNotice, 10)
: undefined,
price: req.body.price,
currency: req.body.currency,
};