perf: Load bookings used for limits in bulk (#13474)

This commit is contained in:
Keith Williams authored and GitHub committed 2024-02-06 16:56:05 -07:00
1 parent 903a154dbc
commit 512628e8ab
7 files changed
+97 -46

No files matched your search

+4 -2
View File
@@ -206,11 +206,13 @@ export const stringOrNumber = z.union([
z.number().int(),
]);
export const stringToDayjs = z.string().transform((val) => {
export const stringToDayjs = (val: string) => {
const matches = val.match(/([+-]\d{2}:\d{2})$/);
const timezone = matches ? matches[1] : "+00:00";
return dayjs(val).utcOffset(timezone);
});
};
export const stringToDayjsZod = z.string().transform(stringToDayjs);
export const bookingCreateBodySchema = z.object({
end: z.string().optional(),