new attribute "hide_in_autocomplete", fixes #16

This commit is contained in:
azivner
2018-02-13 22:30:33 -05:00
parent 1cef0ce5f9
commit 2e8eeda5ab
6 changed files with 33 additions and 2 deletions

View File

@@ -29,8 +29,20 @@ router.get('/', auth.checkApiAuth, wrap(async (req, res, next) => {
protected_session.decryptNotes(req, notes);
const hiddenInAutocomplete = await sql.getColumn(`
SELECT
DISTINCT noteId
FROM
attributes
JOIN notes USING(noteId)
WHERE
attributes.name = 'hide_in_autocomplete'
AND attributes.isDeleted = 0
AND notes.isDeleted = 0`);
res.send({
notes: notes,
hiddenInAutocomplete: hiddenInAutocomplete,
start_note_path: await options.getOption('start_note_path')
});
}));