Skip to content

Commit 05ce7f4

Browse files
authored
Merge pull request #35 from DevKor-github/fix/folloiwng-error
fix: following error
2 parents 3944ff6 + 5ba446e commit 05ce7f4

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/restaurant/controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ export class RestaurantController {
3535
});
3636
}
3737

38-
return RestaurantResponse.fromEntity(resp);
38+
return res.status(HttpStatus.OK).json(RestaurantResponse.fromEntity(resp));
3939
}
4040
}

src/restaurant/repositories/restaurant.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class RestaurantRepository {
6060
}
6161

6262
async findById(id: string): Promise<RestaurantEntity | null> {
63-
const restaurant = await this.prisma.restaurant.findUnique({
63+
const restaurant = await this.prisma.restaurant.findFirst({
6464
where: { id },
6565
});
6666
return restaurant ? this.mapToRestaurantEntity(restaurant) : null;

src/user/controller.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export class UserController {
174174
@User() user: any,
175175
@Res() res: Response,
176176
) {
177-
const result = await this.followUserUseCase.execute(user.id, userId);
177+
const result = await this.followUserUseCase.execute(userId, user.id);
178178
return res.status(HttpStatus.CREATED).json(result); // TODO: into FollowerResponse
179179
}
180180

@@ -306,14 +306,17 @@ export class UserController {
306306
@ApiResponse({
307307
status: 200,
308308
description: 'userId에 따라 FollowingStatus 반환',
309-
type: CheckFollowingStatusDto
309+
type: CheckFollowingStatusDto,
310310
})
311311
async checkFollowingStatus(
312312
@User('id') userId: string,
313313
@Param('userId') targetUserId: string,
314314
@Res() res: Response,
315-
){
316-
const result = await this.checkFollowingStatusUsecase.execute(userId, targetUserId)
317-
return res.status(HttpStatus.OK).json(result)
315+
) {
316+
const result = await this.checkFollowingStatusUsecase.execute(
317+
userId,
318+
targetUserId,
319+
);
320+
return res.status(HttpStatus.OK).json(result);
318321
}
319322
}

0 commit comments

Comments
 (0)