Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public ResponseEntity<MemberProfileSpecificResponse> getUserProfile (
@PathVariable Long id,
@Parameter(hidden = true) @AuthenticationPrincipal Long userId
) {
MemberProfileSpecificResponse response = memberService.getMemberProfile(id, userId);
MemberProfileSpecificResponse response = memberService.getMemberProfile(id, false);
sortProfileCareer(response);
return ResponseEntity.status(HttpStatus.OK).body(response);
}
Expand All @@ -159,7 +159,7 @@ public ResponseEntity<MemberProfileSpecificResponse> getUserProfile (
public ResponseEntity<MemberProfileSpecificResponse> getMyProfile (
@Parameter(hidden = true) @AuthenticationPrincipal Long userId
) {
MemberProfileSpecificResponse response = memberService.getMemberProfile(userId, userId);
MemberProfileSpecificResponse response = memberService.getMemberProfile(userId, true);
sortProfileCareer(response);
return ResponseEntity.status(HttpStatus.OK).body(response);
}
Expand Down Expand Up @@ -302,4 +302,4 @@ private void sortProfileCareer (MemberProfileSpecificResponse response) {
response.careers().remove(index+1);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,9 @@ public List<MemberResponse> getMemberByName(String name) {
}

@Transactional(readOnly = true)
public MemberProfileSpecificResponse getMemberProfile(Long profileId, Long viewerId) {
boolean isMine = Objects.equals(profileId, viewerId);
public MemberProfileSpecificResponse getMemberProfile(Long profileId, Boolean isMine) {
Member member = getMemberHasProfileById(profileId);
// 내 프로필 조회인 경우 원본 team 정보 사용, 다른 사람 프로필 조회인 경우 role 변환된 team 정보 사용
// 내 프로필 조회 (수정 목적)인 경우 원본 team 정보 사용, 일반 프로필 조회인 경우 role 변환된 team 정보 사용
InternalUserDetails userDetails = isMine
? platformService.getInternalUserWithOriginalTeam(profileId)
: platformService.getInternalUser(profileId);
Expand Down