Skip to content

Commit

Permalink
Merge pull request #141 from sheexiong/master
Browse files Browse the repository at this point in the history
Update DeleteItem and in Parser class.
  • Loading branch information
sheexiong authored Mar 17, 2020
2 parents 8e511c0 + 8211cdd commit 71c20a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
public class DeleteItemCommand extends Command {

public static final String COMMAND_WORD = "deleteItem";
public static final String COMMAND_WORD = "deleteitem";

public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": Deletes the item identified by the index number used in the displayed item list.\n"
Expand All @@ -29,7 +29,7 @@ public DeleteItemCommand(Index targetIndex) {
@Override
public CommandResult execute(Model model) throws CommandException {
requireNonNull(model);
model.deleteEntry(targetIndex.getZeroBased());
//model.deleteEntry(targetIndex.getZeroBased());
return new CommandResult(String.format(MESSAGE_DELETE_PERSON_SUCCESS, targetIndex.getOneBased()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import seedu.eylah.expensesplitter.logic.commands.AddItemCommand;
import seedu.eylah.expensesplitter.logic.commands.BackCommand;
import seedu.eylah.expensesplitter.logic.commands.Command;
import seedu.eylah.expensesplitter.logic.commands.DeleteItemCommand;
import seedu.eylah.expensesplitter.logic.commands.ListAmountCommand;
import seedu.eylah.expensesplitter.logic.commands.ListReceiptCommand;
import seedu.eylah.expensesplitter.logic.commands.PaidCommand;
import seedu.eylah.expensesplitter.logic.parser.exceptions.ParseException;
Expand Down Expand Up @@ -56,7 +58,11 @@ public Command parseCommand(String userInput) throws ParseException {
case AddItemCommand.COMMAND_WORD:
return new AddItemCommandParser().parse(arguments);

case DeleteItemCommand.COMMAND_WORD:
return new DeleteItemCommandParser().parse(arguments);

case ListAmountCommand.COMMAND_WORD:
return new ListAmountCommand(); // No Args so no need to Parse.

default:
throw new ParseException(MESSAGE_UNKNOWN_COMMAND);
Expand Down

0 comments on commit 71c20a7

Please sign in to comment.