allow duplicated attribute per note (in effect attributes can be multi-valued). Closes #33

This commit is contained in:
azivner
2018-02-06 21:18:09 -05:00
parent c2a2f195aa
commit 7c74c77a2c
6 changed files with 7 additions and 6 deletions

View File

@@ -62,6 +62,8 @@ router.get('/', auth.checkApiAuth, wrap(async (req, res, next) => {
const {query, params} = getSearchQuery(attrFilters, searchText);
console.log(query, params);
const noteIds = await sql.getColumn(query, params);
res.send(noteIds);
@@ -152,7 +154,7 @@ function getSearchQuery(attrFilters, searchText) {
searchParams.push(searchText); // two occurences in searchCondition
}
const query = `SELECT notes.noteId FROM notes
const query = `SELECT DISTINCT notes.noteId FROM notes
${joins.join('\r\n')}
WHERE
notes.isDeleted = 0