1
0
Fork 0

fix index API for big ids

This commit is contained in:
jsteemann 2017-02-09 16:55:01 +01:00
parent d18567d042
commit e83d554947
1 changed files with 4 additions and 4 deletions

View File

@ -177,13 +177,13 @@ function delete_api_index (req, res) {
return;
}
var iid = parseInt(decodeURIComponent(req.suffix[1]), 10);
var dropped = collection.dropIndex(name + '/' + iid);
var id = name + '/' + req.suffix[1];
var dropped = collection.dropIndex(id);
if (dropped) {
actions.resultOk(req, res, actions.HTTP_OK, { id: name + '/' + iid });
actions.resultOk(req, res, actions.HTTP_OK, { id });
} else {
actions.indexNotFound(req, res, collection, name + '/' + iid);
actions.indexNotFound(req, res, collection, id);
}
}