for title/content search does not make sense to search for protected notes

This commit is contained in:
zadam 2019-12-10 21:40:53 +01:00
parent c48dbb0913
commit ee15db0ae1

View File

@ -113,6 +113,11 @@ module.exports = function(filters, selectedColumns = 'notes.*') {
condition = "NOT(" + condition + ")"; condition = "NOT(" + condition + ")";
} }
if (['text', 'title', 'content'].includes(filter.name)) {
// for title/content search does not make sense to search for protected notes
condition = `(${condition} AND notes.isProtected = 0)`;
}
where += condition; where += condition;
} }
else if ([">", ">=", "<", "<="].includes(filter.operator)) { else if ([">", ">=", "<", "<="].includes(filter.operator)) {