Skip to content

Commit

Permalink
#12 [Update] token이 들어오지 않을 때 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
Anna-Jin committed Aug 1, 2022
1 parent b62f26e commit 1d61757
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public ResponseEntity<PageInfoResponseDto> getStoreReview(@PathVariable int stor
@AuthenticationPrincipal User user,
@PageableDefault(page = 0, size = 5, sort = "id", direction = Sort.Direction.DESC) Pageable pageable) {

PageInfoResponseDto pageInfoResponseDto = reviewService.getReview(storeId, user.getUsername(), pageable);
PageInfoResponseDto pageInfoResponseDto = reviewService.getReview(storeId, user == null ? null : user.getUsername(), pageable);
return new ResponseEntity<>(pageInfoResponseDto, HttpStatus.OK);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ public void userInfo(User user, User myUser){
this.name = user.getName();
this.userImage = user.getProfileImageUrl();

if(this.userId == myUser.getId()){
this.myReview = "Y";
} else if (this.userId != myUser.getId()){
if (myUser != null) {
if(this.userId == myUser.getId()){
this.myReview = "Y";
} else if (this.userId != myUser.getId()){
this.myReview = "N";
}
} else {
this.myReview = "N";
}

Expand Down

0 comments on commit 1d61757

Please sign in to comment.