Skip to content

Commit

Permalink
Merge pull request nus-cs2103-AY2425S1#213 from potaotototo/display-l…
Browse files Browse the repository at this point in the history
…essons

Update display after lesson changes
  • Loading branch information
luileng authored Nov 6, 2024
2 parents 529cff9 + 0dac9ba commit d2bf819
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/main/java/tuteez/logic/commands/AddLessonCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public CommandResult execute(Model model) throws CommandException {
Person updatedPerson = addLessonsToPerson(personToUpdate, successfulAdditions);
model.setPerson(personToUpdate, updatedPerson);
model.updateFilteredPersonList(Model.PREDICATE_SHOW_ALL_PERSONS);
model.updateLastViewedPerson(updatedPerson);

String resultMessage = generateResultMessage(personToUpdate, successfulAdditions, failureMessages);
return new CommandResult(resultMessage);
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/tuteez/logic/commands/AddRemarkCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ public CommandResult execute(Model model) throws CommandException {

model.setPerson(personToUpdate, updatedPerson);
model.updateFilteredPersonList(Model.PREDICATE_SHOW_ALL_PERSONS);

// Update the last viewed person in the model after updating remarks
model.updateLastViewedPerson(updatedPerson);

return new CommandResult(String.format("Added remark to %1$s: %2$s",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public CommandResult execute(Model model) throws CommandException {
Person updatedPerson = updatePersonLessons(personToUpdate, currentLessons);
model.setPerson(personToUpdate, updatedPerson);
model.updateFilteredPersonList(Model.PREDICATE_SHOW_ALL_PERSONS);
model.updateLastViewedPerson(updatedPerson);

return new CommandResult(generateResultMessage(personToUpdate, lessonsToDelete));
}
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/tuteez/logic/commands/DeleteRemarkCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ public CommandResult execute(Model model) throws CommandException {

model.setPerson(personToUpdate, updatedPerson);
model.updateFilteredPersonList(Model.PREDICATE_SHOW_ALL_PERSONS);

// Update the last viewed person in the model after updating remarks
model.updateLastViewedPerson(updatedPerson);

return new CommandResult(String.format("Deleted remark at index %1$s from %2$s", remarkIndex.getOneBased(),
Expand Down

0 comments on commit d2bf819

Please sign in to comment.