#58 added test for /api/remove

This commit is contained in:
Danielv123 committed 2017-10-31 20:04:59 +01:00
1 parent 0dd6315abc
commit ea603c61fd
2 files changed
+22 -10

No files matched your search

+4 -3
View File
@@ -271,12 +271,13 @@ app.post("/api/remove", function(req, res) {
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
// save items we get
var object = req.body;
if(!object.instanceName) {
object.instanceName = "unknown"
}
if(!object.instanceID) {
object.instanceID = "unknown"
}
if(!object.instanceName) {
object.instanceName = "unknown";
}
if(slaves[object.instanceID]) object.instanceName = slaves[object.instanceID].instanceName;
let item = db.items[object.name]
// console.dir(doc);
if (!item) {