Skip to content

Commit

Permalink
refactor: slight logic modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
jimlambie committed Aug 1, 2018
1 parent 214d495 commit d5949a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dadi/lib/controller/searchIndex.js
Expand Up @@ -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()
}

Expand Down
6 changes: 1 addition & 5 deletions dadi/lib/search/index.js
Expand Up @@ -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()
}

Expand Down

0 comments on commit d5949a0

Please sign in to comment.