Skip to content

Commit

Permalink
Fix bug causing deletion of appointments based on person equality ins…
Browse files Browse the repository at this point in the history
…tead of personId equality
  • Loading branch information
zaidansani committed Nov 11, 2024
1 parent a36e5e4 commit f94da73
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion src/main/java/seedu/address/model/AppointmentBook.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ public Appointment addAppointment(Person person, AppointmentDescriptor appointme
*/
public void setAppointment(Appointment target, Appointment editedAppointment) {
requireNonNull(editedAppointment);

appointments.setAppointment(target, editedAppointment);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void setAppointments(List<Appointment> appointments) {
*/
public void removeAppointmentsForPerson(Person toRemove) {
requireNonNull(toRemove);
internalList.removeIf(appointment -> appointment.getPerson().equals(toRemove));
internalList.removeIf(appointment -> appointment.getPersonId() == toRemove.getPersonId());
}

/**
Expand Down

0 comments on commit f94da73

Please sign in to comment.