Skip to content

Commit 293e15e

Browse files
committed
feat: dto fix
1 parent 530c143 commit 293e15e

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

libraries/nestjs-libraries/src/dtos/posts/providers-settings/pinterest.dto.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
import {
2-
IsDefined,
3-
IsOptional,
4-
IsString,
5-
IsUrl,
6-
MaxLength,
7-
MinLength,
2+
IsDefined, IsOptional, IsString, IsUrl, MaxLength, MinLength, ValidateIf
83
} from 'class-validator';
94

105
export class PinterestSettingsDto {
116
@IsString()
12-
@IsOptional()
7+
@ValidateIf((o) => !!o.title)
138
@MaxLength(100)
149
title: string;
1510

1611
@IsString()
17-
@IsOptional()
12+
@ValidateIf((o) => !!o.link)
1813
@IsUrl()
1914
link: string;
2015

2116
@IsString()
22-
@IsOptional()
17+
@ValidateIf((o) => !!o.dominant_color)
2318
dominant_color: string;
2419

2520
@IsDefined({

0 commit comments

Comments
 (0)