From 95d7b49f3666b6b2c0e500442956dd651db8eff1 Mon Sep 17 00:00:00 2001 From: danielailie Date: Mon, 9 Oct 2023 16:10:38 +0300 Subject: [PATCH] Fix max validation --- src/modules/marketplaces/models/UpdateMarketplaceArgs.ts | 5 +++-- src/modules/marketplaces/models/WhitelistCollectionArgs.ts | 4 ++-- src/modules/marketplaces/models/WhitelistMarketplaceArgs.ts | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/modules/marketplaces/models/UpdateMarketplaceArgs.ts b/src/modules/marketplaces/models/UpdateMarketplaceArgs.ts index 6ab9aab47..fd8c8f481 100644 --- a/src/modules/marketplaces/models/UpdateMarketplaceArgs.ts +++ b/src/modules/marketplaces/models/UpdateMarketplaceArgs.ts @@ -1,10 +1,11 @@ import { Field, InputType } from '@nestjs/graphql'; -import { IsOptional, Matches, Max } from 'class-validator'; +import { IsOptional, Matches, Max, MaxLength } from 'class-validator'; import { ADDRESS_RGX, ADDRESS_ERROR } from 'src/utils/constants'; @InputType() export class UpdateMarketplaceArgs { - @Max(62) + @IsOptional() + @MaxLength(62) @Field({ description: 'This field will be shown on external apps like xSpothlight, xPortal!', nullable: true }) marketplaceName: string; diff --git a/src/modules/marketplaces/models/WhitelistCollectionArgs.ts b/src/modules/marketplaces/models/WhitelistCollectionArgs.ts index 7ce5e33b1..33a042071 100644 --- a/src/modules/marketplaces/models/WhitelistCollectionArgs.ts +++ b/src/modules/marketplaces/models/WhitelistCollectionArgs.ts @@ -1,5 +1,5 @@ import { Field, InputType } from '@nestjs/graphql'; -import { Matches, Max } from 'class-validator'; +import { Matches, MaxLength } from 'class-validator'; import { COLLECTION_IDENTIFIER_ERROR, COLLECTION_IDENTIFIER_RGX } from 'src/utils/constants'; @InputType() @@ -10,7 +10,7 @@ export class WhitelistCollectionArgs { @Field() collection: string; - @Max(62) + @MaxLength(62) @Field() marketplaceKey: string; } diff --git a/src/modules/marketplaces/models/WhitelistMarketplaceArgs.ts b/src/modules/marketplaces/models/WhitelistMarketplaceArgs.ts index 36d03578b..9d21593d7 100644 --- a/src/modules/marketplaces/models/WhitelistMarketplaceArgs.ts +++ b/src/modules/marketplaces/models/WhitelistMarketplaceArgs.ts @@ -1,5 +1,5 @@ import { Field, InputType } from '@nestjs/graphql'; -import { IsOptional, Matches, Max } from 'class-validator'; +import { IsOptional, Matches, MaxLength } from 'class-validator'; import { ADDRESS_RGX, ADDRESS_ERROR } from 'src/utils/constants'; @InputType() @@ -7,7 +7,7 @@ export class WhitelistMarketplaceArgs { @Field({ description: 'This field will be shown on external apps like xSpothlight, xPortal!' }) marketplaceName: string; - @Max(62) + @MaxLength(62) @Field({ description: 'This should de a unique key, so choose wisely!' }) marketplaceKey: string;