Files
prowler/types/formSchemas.ts
T
2024-09-24 08:09:02 +02:00

16 lines
455 B
TypeScript

import { z } from "zod";
export const editProviderFormSchema = (currentAlias: string) =>
z.object({
alias: z
.string()
.refine((val) => val === "" || val.length >= 3, {
message: "The alias must be empty or have at least 3 characters.",
})
.refine((val) => val !== currentAlias, {
message: "The new alias must be different from the current one.",
})
.optional(),
providerId: z.string(),
});