Notes/src/services/event_log.js

23 lines
532 B
JavaScript
Raw Normal View History

const sql = require('./sql');
2018-04-02 20:46:46 -04:00
const dateUtils = require('./date_utils');
const utils = require('./utils');
2017-11-05 21:56:42 -05:00
const log = require('./log');
async function addEvent(comment) {
await addNoteEvent(null, comment);
}
async function addNoteEvent(noteId, comment) {
await sql.insert('event_log', {
eventId: utils.newEntityId(),
noteId : noteId,
comment: comment,
dateCreated: dateUtils.nowDate()
});
2017-11-05 21:56:42 -05:00
log.info("Event log for " + noteId + ": " + comment);
}
module.exports = {
addEvent
};