11import {
2+ BadRequestException ,
23 Body ,
34 Controller ,
45 Delete ,
@@ -59,7 +60,7 @@ export class CafeController {
5960 summary : 'get my liked cafe list' ,
6061 } )
6162 @ApiOkResponse ( {
62- type : Array < PaginationCafeListResDto > ,
63+ type : PaginationCafeListResDto ,
6364 description : 'Cafe list that I liked' ,
6465 } )
6566 @ApiInternalServerErrorResponse ( {
@@ -79,7 +80,7 @@ export class CafeController {
7980 summary : 'search cafe by name' ,
8081 } )
8182 @ApiOkResponse ( {
82- type : Array < PaginationCafeListResDto > ,
83+ type : PaginationCafeListResDto ,
8384 description : 'Cafe list containing search keyword' ,
8485 } )
8586 @ApiInternalServerErrorResponse ( {
@@ -90,6 +91,10 @@ export class CafeController {
9091 @Query ( 'name' ) name : string ,
9192 @Query ( ) query : PaginationDto ,
9293 ) : Promise < PaginationCafeListResDto > {
94+ if ( ! name || name . trim ( ) === '' ) {
95+ throw new BadRequestException ( 'Name is required' ) ;
96+ }
97+
9398 return await this . cafeService . searchCafeByName ( name , query ) ;
9499 }
95100
0 commit comments