Skip to content

Commit

Permalink
[ADD] added deleted history date
Browse files Browse the repository at this point in the history
  • Loading branch information
thguss committed Jan 15, 2025
1 parent edc015e commit f6ea57d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public void achieve() {
this.isAchieved = !this.isAchieved;
}

public void cancel() {
if (updatedAt.equals(LocalDate.now())) {
public void cancel(LocalDate historyDate) {
if (historyDate.equals(LocalDate.now())) {
this.isAchievedToday = false;
this.isAchieved = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private Map<Theme, Map<Routine, MemberRoutine>> toRoutinesByTheme(
public void deleteHistory(long historyId) {
val history = routineHistoryAdapter.findById(historyId);
val memberRoutine = memberRoutineAdapter.findById(history.getMemberRoutineId());
memberRoutine.cancel();
memberRoutine.cancel(history.getCreatedAt().toLocalDate());
memberRoutineAdapter.update(memberRoutine);
routineHistoryAdapter.deleteById(historyId);
}
Expand Down

0 comments on commit f6ea57d

Please sign in to comment.