File tree Expand file tree Collapse file tree 4 files changed +8
-38
lines changed
Expand file tree Collapse file tree 4 files changed +8
-38
lines changed Original file line number Diff line number Diff line change 11import { applyDecorators } from '@nestjs/common' ;
22import {
3+ ApiBadRequestResponse ,
34 ApiNotFoundResponse ,
45 ApiOkResponse ,
56 ApiOperation ,
@@ -27,5 +28,11 @@ export function ApiRequestDeleteRss() {
2728 message : 'RSS 데이터를 찾을 수 없습니다.' ,
2829 } ,
2930 } ) ,
31+ ApiBadRequestResponse ( {
32+ description : 'Bad Request' ,
33+ example : {
34+ message : '오류 메세지' ,
35+ } ,
36+ } ) ,
3037 ) ;
3138}
Original file line number Diff line number Diff line change @@ -9,14 +9,6 @@ export class RequestDeleteRssDto {
99 @IsUrl ( { } , { message : '유효한 URL을 입력해주세요.' } )
1010 blogUrl : string ;
1111
12- @ApiProperty ( {
13- example : 'example user name' ,
14- description : '사용자 이름을 입력해주세요.' ,
15- } )
16- @IsNotEmpty ( { message : '유저 이름은 반드시 입력해야 합니다.' } )
17- @IsString ( { message : '문자열로 입력해주세요.' } )
18- userName : string ;
19-
2012 @ApiProperty ( {
2113 example : 'example@example.com' ,
2214 description : '이메일 주소를 입력해주세요.' ,
Original file line number Diff line number Diff line change @@ -186,14 +186,12 @@ export class RssService {
186186 where : {
187187 rssUrl : requestDeleteRssDto . blogUrl ,
188188 email : requestDeleteRssDto . email ,
189- userName : requestDeleteRssDto . userName ,
190189 } ,
191190 } ) ,
192191 this . rssRepository . findOne ( {
193192 where : {
194193 rssUrl : requestDeleteRssDto . blogUrl ,
195194 email : requestDeleteRssDto . email ,
196- userName : requestDeleteRssDto . userName ,
197195 } ,
198196 } ) ,
199197 ] ) ;
@@ -212,7 +210,7 @@ export class RssService {
212210 ) ;
213211
214212 this . emailService . sendRssRemoveCertificationMail (
215- requestDeleteRssDto . userName ,
213+ rssAccept ?. userName ?? rssWait . userName ,
216214 requestDeleteRssDto . email ,
217215 requestDeleteRssDto . blogUrl ,
218216 certificateCode ,
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ describe('RequestDeleteRssDto Test', () => {
77 beforeEach ( ( ) => {
88 dto = new RequestDeleteRssDto ( {
99 blogUrl : 'https://test.com/rss' ,
10- userName : 'test' ,
1110 email : 'test@test.com' ,
1211 } ) ;
1312 } ) ;
@@ -40,32 +39,6 @@ describe('RequestDeleteRssDto Test', () => {
4039 ) ;
4140 } ) ;
4241
43- it ( '사용자 이름이 없다.' , async ( ) => {
44- // given
45- delete dto . userName ;
46-
47- // when
48- const errors = await validate ( dto ) ;
49-
50- // then
51- expect ( errors [ 0 ] . constraints ) . toHaveProperty (
52- 'isNotEmpty' ,
53- '유저 이름은 반드시 입력해야 합니다.' ,
54- ) ;
55- } ) ;
56- it ( '사용자 이름이 문자열이 아니다.' , async ( ) => {
57- // given
58- dto . userName = 100 as any ;
59-
60- // when
61- const errors = await validate ( dto ) ;
62-
63- // then
64- expect ( errors [ 0 ] . constraints ) . toHaveProperty (
65- 'isString' ,
66- '문자열로 입력해주세요.' ,
67- ) ;
68- } ) ;
6942 it ( '이메일 주소가 없다.' , async ( ) => {
7043 // given
7144 delete dto . email ;
You can’t perform that action at this time.
0 commit comments