diff --git a/alfalfa_web/server/api-v2.js b/alfalfa_web/server/api-v2.js index 8fd04643..d6e962ed 100644 --- a/alfalfa_web/server/api-v2.js +++ b/alfalfa_web/server/api-v2.js @@ -377,7 +377,7 @@ router.post("/runs/:runId/points", async (req, res, next) => { */ router.get("/runs/:runId/points/values", (req, res, next) => { api - .getPointsByRun(req.run) + .getPointsByType(req.run, ["OUTPUT", "BIDIRECTIONAL"]) .then(async (points) => { const payload = {}; await Promise.all( diff --git a/alfalfa_web/server/api.js b/alfalfa_web/server/api.js index 6adfd15b..b9768999 100644 --- a/alfalfa_web/server/api.js +++ b/alfalfa_web/server/api.js @@ -173,9 +173,9 @@ class AlfalfaAPI { removeRun = async (run) => { // Delete run - await this.run.deleteOne({ _id: run._id }); + const { deletedCount } = await this.run.deleteOne({ _id: run._id }); - if (run) { + if (deletedCount == 1) { // Delete points await this.points.deleteMany({ run: run._id }); @@ -188,7 +188,9 @@ class AlfalfaAPI { const key = await scan(this.redis, run.ref_id); if (key.length) await del(this.redis, key); - return true; + return Promise.resolve(); + } else { + return Promise.reject("Could not remove Run"); } }; @@ -346,7 +348,7 @@ class AlfalfaAPI { if (deletedCount == 1) { return Promise.resolve(); } else { - return Promise.reject(); + return Promise.reject("Could not remove Alias"); } };