remove passthrough, remove redudnant refine
This commit is contained in:
1 parent
9fd006cfff
commit
a1858e8302
2 files changed
+3
-10
No files matched your search
@@ -79,8 +79,7 @@ export const createMonitorBodyValidation = z.object({
|
|||||||
geoCheckInterval: z.number().min(300000).optional(),
|
geoCheckInterval: z.number().min(300000).optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const editMonitorBodyValidation = z
|
export const editMonitorBodyValidation = z.object({
|
||||||
.object({
|
|
||||||
name: z.string().optional(),
|
name: z.string().optional(),
|
||||||
type: z.string().optional(),
|
type: z.string().optional(),
|
||||||
url: z.string().optional(),
|
url: z.string().optional(),
|
||||||
@@ -107,8 +106,7 @@ export const editMonitorBodyValidation = z
|
|||||||
geoCheckEnabled: z.boolean().optional(),
|
geoCheckEnabled: z.boolean().optional(),
|
||||||
geoCheckLocations: z.array(z.enum(GeoContinents)).optional(),
|
geoCheckLocations: z.array(z.enum(GeoContinents)).optional(),
|
||||||
geoCheckInterval: z.number().min(300000).optional(),
|
geoCheckInterval: z.number().min(300000).optional(),
|
||||||
})
|
});
|
||||||
.passthrough();
|
|
||||||
|
|
||||||
export const pauseMonitorParamValidation = z.object({
|
export const pauseMonitorParamValidation = z.object({
|
||||||
monitorId: z.string().min(1, "Monitor ID is required"),
|
monitorId: z.string().min(1, "Monitor ID is required"),
|
||||||
|
|||||||
@@ -13,12 +13,7 @@ export const nameValidation = z
|
|||||||
"Names must contain at least 1 letter and may only include letters, currency symbols, spaces, apostrophes, hyphens (-), periods (.), and parentheses ()."
|
"Names must contain at least 1 letter and may only include letters, currency symbols, spaces, apostrophes, hyphens (-), periods (.), and parentheses ()."
|
||||||
);
|
);
|
||||||
|
|
||||||
export const lowercaseEmailValidation = z
|
export const lowercaseEmailValidation = z.email().transform((val) => val.toLowerCase());
|
||||||
.email()
|
|
||||||
.transform((val) => val.toLowerCase())
|
|
||||||
.refine((val) => val === val.toLowerCase(), {
|
|
||||||
message: "Email must be in lowercase",
|
|
||||||
});
|
|
||||||
|
|
||||||
export const booleanCoercion = z.preprocess((val) => {
|
export const booleanCoercion = z.preprocess((val) => {
|
||||||
if (val === "true" || val === true) return true;
|
if (val === "true" || val === true) return true;
|
||||||
|
|||||||
Reference in new issue
Block a user