Commit e4924602 authored by NGPixel's avatar NGPixel

Fix duplicate search entries when editing

parent 8eb21863
...@@ -114,8 +114,8 @@ module.exports = { ...@@ -114,8 +114,8 @@ module.exports = {
AND: { 'entryPath': [entryPath] } AND: { 'entryPath': [entryPath] }
}] }]
})).then((results) => { })).then((results) => {
if (results.totalHits > 0) { if (results && results.length > 0) {
let delIds = _.map(results.hits, 'id') let delIds = _.map(results, 'id')
return self._si.delAsync(delIds) return self._si.delAsync(delIds)
} else { } else {
return true return true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment