Skip to content

Commit

Permalink
chore (#3) : 내 결과 조회시 인증 여부 확인
Browse files Browse the repository at this point in the history
  • Loading branch information
daehwan2yo committed Apr 11, 2022
1 parent f78eae9 commit ba4968f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ private int extractStudyDegree(CreateCalendarRequest.ExamInfo dto) {

@GetMapping(value = "/my/calendar/result", produces = APPLICATION_JSON_VALUE)
public ResponseEntity<CalendarResponse> getMyCalenderResponse(@LoginAccount Account account) {
if(account.isAnonymous()) {
throw new IllegalStateException("need authentication to retrieve self result");
}
Calendar calendar = calendarService.find(account);

return ResponseEntity.ok(CalendarResponse.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public Calendar create(Account account, int tendency, String nickname, int daily
account.setDailyQuota(dailyQuota);
account.setNickname(nickname);
account.setTendency(tendency);

accountRepository.save(account);
dailyPlanRepository.saveAll(dailyPlans);
examRepository.saveAll(exams);
Expand Down

0 comments on commit ba4968f

Please sign in to comment.