Skip to content

Commit

Permalink
Add link max length
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemKolodko committed Dec 4, 2024
1 parent 2af2a96 commit 4b96500
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/dto/metadata.dto.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { ApiProperty } from '@nestjs/swagger';
import {IsOptional, IsString} from 'class-validator';
import {IsOptional, IsString, MaxLength} from 'class-validator';
import {Type} from "class-transformer";

const LinkMaxLength = 128

export class AddTokenMetadataDto {
@ApiProperty({ type: String, required: true })
@Type(() => String)
Expand All @@ -25,18 +27,21 @@ export class AddTokenMetadataDto {

@ApiProperty({ type: String, required: false })
@Type(() => String)
@MaxLength(LinkMaxLength, { message: `Link must not exceed ${LinkMaxLength} characters` })
@IsString()
@IsOptional()
twitterLink: string;

@ApiProperty({ type: String, required: false })
@Type(() => String)
@MaxLength(LinkMaxLength, { message: `Link must not exceed ${LinkMaxLength} characters` })
@IsString()
@IsOptional()
telegramLink: string;

@ApiProperty({ type: String, required: false })
@Type(() => String)
@MaxLength(LinkMaxLength, { message: `Link must not exceed ${LinkMaxLength} characters` })
@IsString()
@IsOptional()
websiteLink: string;
Expand Down

0 comments on commit 4b96500

Please sign in to comment.