diff --git a/packages/features/team-accounts/src/schema/create-team.schema.ts b/packages/features/team-accounts/src/schema/create-team.schema.ts index 7284bb008..60c5109b1 100644 --- a/packages/features/team-accounts/src/schema/create-team.schema.ts +++ b/packages/features/team-accounts/src/schema/create-team.schema.ts @@ -15,7 +15,7 @@ const RESERVED_NAMES_ARRAY = [ /** * @name TeamNameSchema */ -const TeamNameSchema = z +export const TeamNameSchema = z .string({ description: 'The name of the team account', }) @@ -23,7 +23,7 @@ const TeamNameSchema = z .max(50) .refine( (name) => { - return !RESERVED_NAMES_ARRAY.includes(name); + return !RESERVED_NAMES_ARRAY.includes(name.toLowerCase()); }, { message: 'teams:reservedNameError', diff --git a/packages/features/team-accounts/src/schema/update-team-name.schema.ts b/packages/features/team-accounts/src/schema/update-team-name.schema.ts index 413092377..9ad5a174e 100644 --- a/packages/features/team-accounts/src/schema/update-team-name.schema.ts +++ b/packages/features/team-accounts/src/schema/update-team-name.schema.ts @@ -1,7 +1,9 @@ import { z } from 'zod'; +import { TeamNameSchema } from './create-team.schema'; + export const TeamNameFormSchema = z.object({ - name: z.string().min(1).max(255), + name: TeamNameSchema, }); export const UpdateTeamNameSchema = TeamNameFormSchema.merge(