Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] 공유용 출력 뷰에서 공유한 유저가 작성한 카테고리 목록을 조회할 수 있도록 수정 #203

Merged
merged 2 commits into from
Nov 9, 2023
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 @@ -11,6 +11,8 @@
public class AuthLoginResponseDto {
@Schema(description = "닉네임", example = "unan")
private String nickname;
@Schema(description = "멤버 고유 id", example = "382")
private Long memberId;
@Schema(description = "Katchup Access Token", example = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1bmFuIiwiaWF0IjoxNjI0NjQ0NjY2LCJleHAiOj")
private String accessToken;
@Schema(description = "Katchup Refresh Token", example = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1bmFuIiwiaWF0IjoxNjI0NjQ0NjY2LCJleHAiOj")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,17 @@ public AuthLoginResponseDto socialLogin(AuthRequestDto authRequestDto) {

Member signedMember = memberRepository.findByEmailOrThrow(email);

Authentication authentication = new UserAuthentication(signedMember.getId(), null, null);
Long memberId = signedMember.getId();

Authentication authentication = new UserAuthentication(memberId, null, null);

String accessToken = jwtTokenProvider.generateAccessToken(authentication);

String nickname = signedMember.getMemberProfile().getNickname();

return AuthLoginResponseDto.builder()
.nickname(nickname)
.memberId(memberId)
.accessToken(accessToken)
.refreshToken(refreshToken)
.isNewUser(signedMember.isNewUser())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ public ApiResponseDto createCategoryName(Principal principal,
@ApiResponse(responseCode = "400", description = "카테고리 목록 조회 실패", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@GetMapping()
@GetMapping("/{memberId}")
@ResponseStatus(HttpStatus.OK)
public ApiResponseDto<List<CategoryGetResponseDto>> getAllCategory(Principal principal,
public ApiResponseDto<List<CategoryGetResponseDto>> getAllCategory(@PathVariable final Long memberId,
@RequestParam(name = "isShared", required = false) Boolean isShared) {
Long memberId = MemberUtil.getMemberId(principal);
if (isShared != null && isShared) {
return ApiResponseDto.success(categoryService.getSharedCategories(memberId));
}
Expand Down
Loading