introduced NoteFull entity, fixes

This commit is contained in:
azivner
2018-03-25 23:25:17 -04:00
parent cdf94181d2
commit 35998058ce
15 changed files with 184 additions and 165 deletions

View File

@@ -5,7 +5,6 @@ const router = express.Router();
const auth = require('../../services/auth');
const sql = require('../../services/sql');
const notes = require('../../services/notes');
const labels = require('../../services/labels');
const log = require('../../services/log');
const utils = require('../../services/utils');
const protected_session = require('../../services/protected_session');
@@ -26,20 +25,12 @@ router.get('/:noteId', auth.checkApiAuth, wrap(async (req, res, next) => {
protected_session.decryptNote(req, detail);
let labelMap = null;
if (detail.type === 'file') {
// no need to transfer attachment payload for this request
// no need to transfer (potentially large) attachment payload for this request
detail.content = null;
// labels contain important attachment metadata - filename and size
labelMap = await labels.getNoteLabelMap(noteId);
}
res.send({
detail: detail,
labels: labelMap
});
res.send(detail);
}));
router.post('/:parentNoteId/children', auth.checkApiAuth, wrap(async (req, res, next) => {