Skip to content

Commit

Permalink
fix: add team name regex because -solo-team add 10 char to teamname
Browse files Browse the repository at this point in the history
  • Loading branch information
Suboyyy committed Nov 25, 2024
1 parent ba82b4f commit a62a532
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { UserAge, UserType, Permission, Error as ResponseError } from '../types'
// Matches with LoL EUW summoner name
const usernameRegex = /^[0-9\p{L} _#-]{3,22}$/u;
const nameRegex = /^[\p{L}\d _'#-]{3,30}$/u;
const teamnameRegex = /^[\p{L}\d _'#-]{3,40}$/u;
const lastnameRegex = /^[\p{L} _'-]{1,50}$/u;
const passwordRegex = /^.{6,100}$/;
const placeRegex = /^[A-Z]\d{1,3}$/;
Expand Down Expand Up @@ -36,7 +37,7 @@ export const permissions = Joi.string().regex(
export const stringBoolean = Joi.string().valid('true', 'false').error(new Error(ResponseError.stringBooleanError));

// Team
export const teamName = Joi.string().regex(nameRegex).error(new Error(ResponseError.InvalidTeamName));
export const teamName = Joi.string().regex(teamnameRegex).error(new Error(ResponseError.InvalidTeamName));

// Cart
export const quantity = Joi.number().integer().min(1).error(new Error(ResponseError.EmptyBasket));

0 comments on commit a62a532

Please sign in to comment.