Notes/src/routes/api/recent_notes.js

20 lines
454 B
JavaScript
Raw Normal View History

2017-11-04 23:46:50 -04:00
"use strict";
const optionService = require('../../services/options');
2018-04-01 12:03:21 -04:00
const RecentNote = require('../../entities/recent_note');
2017-11-04 23:46:50 -04:00
2018-03-30 15:34:07 -04:00
async function addRecentNote(req) {
const branchId = req.params.branchId;
const notePath = req.params.notePath;
2018-04-02 22:53:01 -04:00
await new RecentNote({
2018-03-30 15:34:07 -04:00
branchId: branchId,
2018-05-26 12:38:25 -04:00
notePath: notePath
2018-04-02 22:53:01 -04:00
}).save();
2018-03-30 15:34:07 -04:00
2018-04-02 21:47:46 -04:00
await optionService.setOption('startNotePath', notePath);
2018-03-30 15:34:07 -04:00
}
module.exports = {
addRecentNote
};