From 94ad2d8eed2d974a4955fd8feea94c22464af464 Mon Sep 17 00:00:00 2001 From: Zaven Arra Date: Wed, 4 Aug 2021 18:12:44 -0700 Subject: [PATCH] fix: use delete to remove key --- src/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app.js b/src/app.js index 8e89630..b4e47db 100644 --- a/src/app.js +++ b/src/app.js @@ -71,10 +71,10 @@ app.get("/tree", async function (req, res){ } else if(treeName){ treeDetail = await tree.getTreeByName(treeName); } else { - console.warn("no tree id", treeId); - res.status(400).json({message:"no tree id"}); + console.warn("tree_id did not match any record", treeId); + res.status(400).json({message:"tree_id did not match any record"}); } - treeDetail.planter_identifier = ""; + delete treeDetail.planter_identifier; res.status(200).json(treeDetail);