Skip to content

Commit

Permalink
Merge pull request #341 from zaidansani/fix-appointment-deletion-by-p…
Browse files Browse the repository at this point in the history
…ersonId

Fix delete person before edit bug
  • Loading branch information
jayjay19630 authored Nov 11, 2024
2 parents 20bb164 + f94da73 commit 9c3d19e
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 9c3d19e

Please sign in to comment.