Reload data when entries or treatments are deleted

This commit is contained in:
Jeremy Cunningham
2018-12-07 17:40:04 -06:00
parent 1734ec1731
commit 440807ef89
2 changed files with 10 additions and 4 deletions
+5 -1
View File
@@ -97,7 +97,11 @@ function storage (env, ctx) {
}
function remove (opts, fn) {
return api( ).remove(query_for(opts), fn);
return api( ).remove(query_for(opts), function (err, stat) {
//TODO: this is triggering a read from Mongo, we can do better
ctx.bus.emit('data-received');
fn(err, stat);
});
}
function save (obj, fn) {