Skip to content

Commit

Permalink
temporary fix for CI tests
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
  • Loading branch information
konstantinabl committed Jul 15, 2024
1 parent 300e92d commit d021fe7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/server/src/validator/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ export function validateParam(index: number | string, param: any, validation: an
if (requiredIsMissing(param, validation.required)) {
throw predefined.MISSING_REQUIRED_PARAMETER(index);
}

if (param === null) {
throw predefined.INVALID_PARAMETER(index, `The value passed is not valid: ${param}.`);
}

if (Array.isArray(paramType)) {
if (param != null && Array.isArray(paramType)) {
const results: any[] = [];
for (const type of paramType) {
const validator = Validator.TYPES[type];
Expand All @@ -31,7 +30,7 @@ export function validateParam(index: number | string, param: any, validation: an
}
}

if (!Array.isArray(paramType)) {
if (param != null && !Array.isArray(paramType)) {
const result = isArray ? paramType.test(index, param, validation.type[1]) : paramType.test(param);
if (result === false) {
throw predefined.INVALID_PARAMETER(index, `${paramType.error}, value: ${param}`);
Expand Down

0 comments on commit d021fe7

Please sign in to comment.