Skip to content

Commit

Permalink
Fix max validation
Browse files Browse the repository at this point in the history
  • Loading branch information
danielailie committed Oct 9, 2023
1 parent 1b1e9bf commit 95d7b49
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/modules/marketplaces/models/UpdateMarketplaceArgs.ts
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/modules/marketplaces/models/WhitelistCollectionArgs.ts
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -10,7 +10,7 @@ export class WhitelistCollectionArgs {
@Field()
collection: string;

@Max(62)
@MaxLength(62)
@Field()
marketplaceKey: string;
}
4 changes: 2 additions & 2 deletions src/modules/marketplaces/models/WhitelistMarketplaceArgs.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
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()
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;

Expand Down

0 comments on commit 95d7b49

Please sign in to comment.