File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { Response } from 'express';
1414import {
1515 Coordinate ,
1616 PlantTreeDto ,
17+ TreeDetailListResponse ,
1718 TreeDetailResponse ,
1819 TreeListResponse ,
1920} from './dto' ;
@@ -106,15 +107,15 @@ export class TreeController {
106107 @ApiResponse ( {
107108 status : 200 ,
108109 description : '나무들 상세 정보 반환' ,
109- type : TreeDetailResponse ,
110+ type : TreeDetailListResponse ,
110111 } )
111112 async getTreeByRestaurantId (
112113 @Param ( 'restaurantId' ) restaurantId : string ,
113114 @User ( ) user : UserParam ,
114115 @Res ( ) res : Response ,
115116 ) {
116117 const result = await this . tree . getTreesByRestaurantId ( restaurantId , user ) ;
117- return res . status ( HttpStatus . OK ) . json ( result ) ;
118+ return res . status ( HttpStatus . OK ) . json ( TreeDetailListResponse . from ( result ) ) ;
118119 }
119120
120121 @Post ( ':treeId/water' )
Original file line number Diff line number Diff line change @@ -179,6 +179,20 @@ export class TreeDetailResponse {
179179 images : string [ ] ;
180180}
181181
182+ export class TreeDetailListResponse {
183+ @ApiProperty ( {
184+ description : '나무 목록' ,
185+ type : [ TreeDetailResponse ] ,
186+ } )
187+ items : TreeDetailResponse [ ] ;
188+
189+ static from ( trees : TreeDetailResponse [ ] ) : TreeDetailListResponse {
190+ return {
191+ items : trees ,
192+ } ;
193+ }
194+ }
195+
182196export class TreeListResponse {
183197 @ApiProperty ( {
184198 description : '나무 목록' ,
Original file line number Diff line number Diff line change @@ -45,8 +45,6 @@ import {
4545} from './dtos/updateProfile.dto' ;
4646import { UpdateProfileUseCase } from './usecases/updateProfile' ;
4747import { UpdateMbtiAndTagsUseCase } from './usecases/updateMbtiAndTags' ;
48- import { ProfileResponseDto } from './dtos/profile.response' ;
49- import { GetUserProfileUseCase } from './usecases/getUserProfile' ;
5048import { UnfollowUserUseCase } from './usecases/unfollowUser' ;
5149import { CheckFollowingStatusUseCase } from './usecases/checkFollowingStatus' ;
5250
@@ -91,8 +89,8 @@ export class UserController {
9189 } )
9290 async getUserProfile (
9391 @User ( ) user : UserParam ,
94- @Param ( 'userId' ) userId : string ,
95- @Res ( ) res : Response
92+ @Param ( 'userId' ) userId : string ,
93+ @Res ( ) res : Response ,
9694 ) {
9795 const targetUser = await this . userService . getUser ( userId ) ;
9896 const result = await this . userService . getMypage ( targetUser , user ) ;
You can’t perform that action at this time.
0 commit comments