Skip to content

Commit

Permalink
[BE/#29] Feat : 권한이 없을 경우 유저에게 권한 없다고 JSON 응답 객체를 보낸다
Browse files Browse the repository at this point in the history
  • Loading branch information
hanurii committed Jun 24, 2020
1 parent e35988a commit a1f49b5
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ public ResponseEntity<ApiResponse<IssueDto>> showIssue(@PathVariable Long issueI

@PatchMapping("{issueId}/title")
public ResponseEntity<ApiResponse<?>> updateTitle(@PathVariable Long issueId, @RequestBody UpdateTitleDto updateTitleDto) throws AuthenticationException {
issueService_Hamill.updateTitle(issueId, updateTitleDto);
try {
issueService_Hamill.updateTitle(issueId, updateTitleDto);
} catch (AuthenticationException e) {
return new ResponseEntity<>(ApiResponse.UNAUTHORIZED("권한이 없습니다. 사용자 인증 후 다시 요청 해주세요."), HttpStatus.UNAUTHORIZED);
}
return new ResponseEntity<>(ApiResponse.OK("SUCCESS"), HttpStatus.OK);
}
}

0 comments on commit a1f49b5

Please sign in to comment.