Skip to content

Commit

Permalink
Merge pull request #150 from xGladiate/update-result-display
Browse files Browse the repository at this point in the history
Modify result display for add command
  • Loading branch information
xGladiate authored Nov 1, 2024
2 parents de73b74 + 2acb9e1 commit 1c7e062
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)),
DeliveryAction.ADD);
}
}

Expand Down

0 comments on commit 1c7e062

Please sign in to comment.