Jelajahi Sumber

Fix duplicate search entries when editing

NGPixel 8 tahun lalu
induk
melakukan
e49246028a
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      libs/search.js

+ 2 - 2
libs/search.js

@@ -114,8 +114,8 @@ module.exports = {
           AND: { 'entryPath': [entryPath] }
           AND: { 'entryPath': [entryPath] }
         }]
         }]
       })).then((results) => {
       })).then((results) => {
-        if (results.totalHits > 0) {
-          let delIds = _.map(results.hits, 'id')
+        if (results && results.length > 0) {
+          let delIds = _.map(results, 'id')
           return self._si.delAsync(delIds)
           return self._si.delAsync(delIds)
         } else {
         } else {
           return true
           return true