From a62a532bc91e7e0a3717de2c31f2582ed9fb6ab2 Mon Sep 17 00:00:00 2001 From: Antoine Dufils Date: Mon, 25 Nov 2024 20:43:44 +0100 Subject: [PATCH] fix: add team name regex because -solo-team add 10 char to teamname --- src/utils/validators.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/validators.ts b/src/utils/validators.ts index 69fcfec6..660ca944 100644 --- a/src/utils/validators.ts +++ b/src/utils/validators.ts @@ -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}$/; @@ -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));