Skip to content

Commit

Permalink
Modify result display for add command
Browse files Browse the repository at this point in the history
  • Loading branch information
xGladiate committed Nov 1, 2024
1 parent 5696805 commit 2acb9e1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/seedu/address/logic/commands/AddCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public class AddCommand extends Command {
+ PREFIX_TAG + "Difficult address to deliver "
+ PREFIX_TAG + "Best before Wednesday";

public static final String MESSAGE_SUCCESS_PERSON = "New person added: %1$s";
public static final String MESSAGE_SUCCESS_DELIVERY = "New delivery added to: ";
public static final String MESSAGE_SUCCESS_PERSON = "New person added: \n%1$s";
public static final String MESSAGE_SUCCESS_DELIVERY = "New delivery added for %1$s: \n%2$s";
public static final String MESSAGE_DUPLICATE_PERSON = "This person already exists in the address book";
public static final String MESSAGE_DUPLICATE_PHONE = "\nWarning! There is a person with the same phone number";
public static final String MESSAGE_DUPLICATE_EMAIL = "\nWarning! There is a person with the same email";
Expand Down Expand Up @@ -144,7 +144,10 @@ public CommandResult execute(Model model) throws CommandException {
Person inspectedPerson = InspectWindow.getInspectedPerson();
Index targetIndex = inspectedPerson.getFirstArchivedIndex();
inspectedPerson.addDelivery(targetIndex, this.deliveryToAdd);
return new CommandResult(MESSAGE_SUCCESS_DELIVERY + inspectedPerson.getName(), DeliveryAction.ADD);
return new CommandResult(String.format(MESSAGE_SUCCESS_DELIVERY,
inspectedPerson.getName(),
Messages.format(deliveryToAdd)),

Check warning on line 149 in src/main/java/seedu/address/logic/commands/AddCommand.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/seedu/address/logic/commands/AddCommand.java#L147-L149

Added lines #L147 - L149 were not covered by tests
DeliveryAction.ADD);
}
}

Expand Down

0 comments on commit 2acb9e1

Please sign in to comment.