From 5b7f3b36473cd5f28a62381b8b76033a847fc870 Mon Sep 17 00:00:00 2001 From: Sam Roquitte Date: Wed, 15 Nov 2017 18:00:43 -0600 Subject: [PATCH 1/3] Fix update bug --- scripts/agenda.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/agenda.js b/scripts/agenda.js index 6c6a2e4..13d526e 100644 --- a/scripts/agenda.js +++ b/scripts/agenda.js @@ -91,7 +91,9 @@ function update(robot, id, value) { console.log(new Error(`Value '${id}' is out of bounds of ${getAgendaLength(robot)}`)); return new Error(`There are only ${getAgendaLength(robot)} items. But you tried to update item #${id-1}.`); } - updateBrainData(robot, id, value); + let oldData = getBrainData(robot)[id]; + oldData.value = value; + updateBrainData(robot, id, oldData); return `Updated #${id-1} successfully.`; } From c5f20afec69d3716cb758d7afe34127f3261146e Mon Sep 17 00:00:00 2001 From: Sam Roquitte Date: Wed, 15 Nov 2017 18:05:56 -0600 Subject: [PATCH 2/3] Change web port --- web.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web.js b/web.js index 82e6ac7..325ee2e 100644 --- a/web.js +++ b/web.js @@ -15,7 +15,7 @@ http.createServer(function (req, res) { displayPage(res, cb); } ]); -}).listen(8080); +}).listen(81); function buildHtml(cb) { var header = ''; From 30ea080e9a8b5ac1792b91d7aba3b0790b651006 Mon Sep 17 00:00:00 2001 From: Sam Roquitte Date: Wed, 15 Nov 2017 18:08:56 -0600 Subject: [PATCH 3/3] Fix update success message --- scripts/agenda.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/agenda.js b/scripts/agenda.js index 13d526e..dd1ce2b 100644 --- a/scripts/agenda.js +++ b/scripts/agenda.js @@ -94,7 +94,7 @@ function update(robot, id, value) { let oldData = getBrainData(robot)[id]; oldData.value = value; updateBrainData(robot, id, oldData); - return `Updated #${id-1} successfully.`; + return `Updated #${id+1} successfully.`; } /**