mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 04:21:52 +00:00
16 lines
455 B
TypeScript
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(),
|
|
});
|