mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-25 15:56:19 -05:00
18 lines
496 B
TypeScript
18 lines
496 B
TypeScript
import { z } from "zod";
|
|
import { textFieldRequired } from "~/form/fields";
|
|
import { mySlugify } from "~/utils/urls";
|
|
import { TEAM } from "./team-constants";
|
|
|
|
export const createTeamSchema = z.object({
|
|
name: textFieldRequired({
|
|
label: "labels.name",
|
|
minLength: TEAM.NAME_MIN_LENGTH,
|
|
maxLength: TEAM.NAME_MAX_LENGTH,
|
|
validate: {
|
|
func: (teamName) =>
|
|
mySlugify(teamName).length > 0 && mySlugify(teamName) !== "new",
|
|
message: "forms:errors.noOnlySpecialCharacters",
|
|
},
|
|
}),
|
|
});
|