Makes every day available for events that don't have availability set (#756)
* Abstracts MinutesField * Adds missing Minimum booking notice * Refactoring * Fixes int field sent as string * Sorts slots by time * Fixes availability page * Fixes available days * Type fixes * More availability bugfixes * Makes every day available for events that don't have availability set * Type fixespull/753/head
parent
bcacc1d166
commit
2c50781084
|
@ -65,7 +65,15 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|||
}));
|
||||
|
||||
const timeZone = eventType?.timeZone || currentUser.timeZone;
|
||||
const workingHours = eventType?.availability.length ? eventType.availability : currentUser.availability;
|
||||
const defaultAvailability = {
|
||||
startTime: currentUser.startTime,
|
||||
endTime: currentUser.endTime,
|
||||
days: [0, 1, 2, 3, 4, 5, 6],
|
||||
};
|
||||
const workingHours = eventType?.availability.length
|
||||
? eventType.availability
|
||||
: // currentUser.availability /* note(zomars) There's no UI nor default for this as of today */
|
||||
[defaultAvailability]; /* note(zomars) For now, make every day available as fallback */
|
||||
|
||||
res.status(200).json({
|
||||
busy: bufferedBusyTimes,
|
||||
|
|
Loading…
Reference in New Issue