fix search by attributes was finding also deleted attributes

This commit is contained in:
azivner 2018-08-13 11:06:17 +02:00
parent cd9eef32b0
commit ce5c385c15

View File

@ -7,7 +7,7 @@ module.exports = function(attributeFilters) {
let i = 1;
for (const filter of attributeFilters) {
joins.push(`LEFT JOIN attributes AS attribute${i} ON attribute${i}.noteId = notes.noteId AND attribute${i}.name = ?`);
joins.push(`LEFT JOIN attributes AS attribute${i} ON attribute${i}.noteId = notes.noteId AND attribute${i}.name = ? AND attribute${i}.isDeleted = 0`);
joinParams.push(filter.name);
where += " " + filter.relation + " ";