From a604ad2391d76c23917835eff660d45e665a210d Mon Sep 17 00:00:00 2001 From: samr28 Date: Fri, 13 Oct 2017 23:39:41 -0500 Subject: [PATCH] Fix remove command message formatting --- scripts/agenda.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/agenda.js b/scripts/agenda.js index f582b0a..9ea5542 100644 --- a/scripts/agenda.js +++ b/scripts/agenda.js @@ -29,12 +29,13 @@ function rmByName(robot, value) { return `Removed '${value}' successfully`; } function rmById(robot, id) { + id++; if (id > getAgendaLength(robot)) { console.log(new Error(`Value '${id}' is out of bounds of ${getAgendaLength(robot)}`)); return new Error(`There are only ${getAgendaLength(robot)}. But you tried to remove item #${id}.`); } - removeBrainDataById(robot, id); - return `Removed #${id+1} successfully`; + removeBrainDataById(robot, id-1); + return `Removed #${id} successfully`; } function update(robot, id, value) {