Skip to content

Commit

Permalink
Merge pull request #25 from punch-crush/profile-fix
Browse files Browse the repository at this point in the history
fix: getProfile 시 isfollow 업데이트 안되는 문제
  • Loading branch information
hyeri-woo authored Jun 27, 2024
2 parents 67a826f + 77dd03d commit d2474e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/user/profile.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ export class ProfileController {
@Header('content-type', 'application/json')
@UseGuards(JwtAuthGuard)
@HandleErrors()
async getProfile(@Param('accountname') accountname: string): Promise<InfoResponseDto> {
return await this.profileService.getProfile(accountname);
async getProfile(
@Req() req,
@Param('accountname') accountname: string,
): Promise<InfoResponseDto> {
return await this.profileService.getProfile(req.user._id, accountname);
}

@Post(':accountname/follow')
Expand Down
6 changes: 3 additions & 3 deletions src/user/profile.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ export class ProfileService {
private userService: UserService,
) {}

async getProfile(accountname: string): Promise<InfoResponseDto> {
const user = await this.userService.getUserByAccountName(accountname);
async getProfile(_id: string, accountname: string): Promise<InfoResponseDto> {
const user = await this.userService.getUserByAccountNameResponse(accountname, _id);
return {
profile: user.readOnlyData,
profile: user,
};
}

Expand Down

0 comments on commit d2474e8

Please sign in to comment.