Refactor schedule endpoints (#185)
This commit is contained in:
1 parent
31610dd178
commit
e3fa0e546b
9 files changed
+201
-244
No files matched your search
@@ -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(", ")}`,
|
||||
});
|
||||
Reference in new issue
Block a user