mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 15:11:31 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			462 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			462 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
const sql = require('./sql');
 | 
						|
const utils = require('./utils');
 | 
						|
const log = require('./log');
 | 
						|
 | 
						|
async function addEvent(comment) {
 | 
						|
    await addNoteEvent(null, comment);
 | 
						|
}
 | 
						|
 | 
						|
async function addNoteEvent(noteId, comment) {
 | 
						|
    await sql.insert('event_log', {
 | 
						|
       note_id : noteId,
 | 
						|
       comment: comment,
 | 
						|
       date_added: utils.nowDate()
 | 
						|
    });
 | 
						|
 | 
						|
    log.info("Event log for " + noteId + ": " + comment);
 | 
						|
}
 | 
						|
 | 
						|
module.exports = {
 | 
						|
    addEvent,
 | 
						|
    addNoteEvent
 | 
						|
}; |