This repository was archived by the owner on Jun 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +2
-42
lines changed
Expand file tree Collapse file tree 1 file changed +2
-42
lines changed Original file line number Diff line number Diff line change 55 IsObject ,
66 IsOptional ,
77 IsString ,
8- ValidateBy ,
98 ValidateNested ,
10- ValidationArguments ,
119} from 'class-validator' ;
1210
1311import { CreateIssueRelationDto } from '../issue-relation' ;
@@ -28,49 +26,11 @@ export class CreateIssueDto {
2826 title : string ;
2927
3028 @IsString ( )
31- @ValidateBy (
32- {
33- name : 'eitherDescriptionOrDescriptionMarkdown' ,
34- validator : {
35- validate : ( _value : string , args : ValidationArguments ) : boolean => {
36- const object = args . object as CreateIssueDto ;
37- const { description, descriptionMarkdown } = object ;
38- return ! ! (
39- ( description && descriptionMarkdown ) ||
40- description ||
41- descriptionMarkdown
42- ) ;
43- } ,
44- } ,
45- } ,
46- {
47- message :
48- 'Either description or descriptionMarkdown must be provided, but not both' ,
49- } ,
50- )
29+ @IsOptional ( )
5130 description ?: string ;
5231
5332 @IsString ( )
54- @ValidateBy (
55- {
56- name : 'eitherDescriptionOrDescriptionMarkdown' ,
57- validator : {
58- validate : ( _value : string , args : ValidationArguments ) : boolean => {
59- const object = args . object as CreateIssueDto ;
60- const { description, descriptionMarkdown } = object ;
61- return ! ! (
62- ( description && descriptionMarkdown ) ||
63- description ||
64- descriptionMarkdown
65- ) ;
66- } ,
67- } ,
68- } ,
69- {
70- message :
71- 'Either description or descriptionMarkdown must be provided, but not both' ,
72- } ,
73- )
33+ @IsOptional ( )
7434 descriptionMarkdown ?: string ;
7535
7636 @IsOptional ( )
You can’t perform that action at this time.
0 commit comments