Refactor schedule endpoints (#185)

This commit is contained in:
Omar López authored and GitHub committed 2022-10-13 14:54:38 -06:00
1 parent 31610dd178
commit e3fa0e546b
9 files changed
+201 -244

No files matched your search

+3 -1
View File
@@ -2,4 +2,6 @@ import tzdata from "tzdata";
import * as z from "zod";
// @note: This is a custom validation that checks if the timezone is valid and exists in the tzdb library
export const timeZone = z.string().refine((tz: string) => Object.keys(tzdata.zones).includes(tz));
export const timeZone = z.string().refine((tz: string) => Object.keys(tzdata.zones).includes(tz), {
message: `Expected one of the following: ${Object.keys(tzdata.zones).join(", ")}`,
});