diff --git a/dadi/lib/controller/searchIndex.js b/dadi/lib/controller/searchIndex.js index 363669da..f1c5db3c 100644 --- a/dadi/lib/controller/searchIndex.js +++ b/dadi/lib/controller/searchIndex.js @@ -18,7 +18,7 @@ SearchIndex.prototype.post = function (req, res, next) { } // 404 if Search is not enabled - if (config.get('search.enabled') === false) { + if (config.get('search.enabled') !== true) { return next() } diff --git a/dadi/lib/search/index.js b/dadi/lib/search/index.js index f19aae59..ac869351 100644 --- a/dadi/lib/search/index.js +++ b/dadi/lib/search/index.js @@ -154,11 +154,7 @@ Search.prototype.find = function (searchTerm) { * @return {Promise} - Query to delete instances with matching document ids. */ Search.prototype.delete = function (documents) { - if (!this.canUse()) { - return Promise.resolve() - } - - if (!Array.isArray(documents)) { + if (!this.canUse() || !Array.isArray(documents)) { return Promise.resolve() }