cleaned up images and links which are not used nor supported

This commit is contained in:
azivner
2017-11-29 20:47:01 -05:00
parent d019d0a690
commit 3386cd790e
7 changed files with 13 additions and 59 deletions

View File

@@ -6,21 +6,13 @@ const eventLog = require('./event_log');
const notes = require('./notes');
const sync_table = require('./sync_table');
async function updateNote(entity, links, sourceId) {
async function updateNote(entity, sourceId) {
const origNote = await sql.getSingleResult("SELECT * FROM notes WHERE note_id = ?", [entity.note_id]);
if (!origNote || origNote.date_modified <= entity.date_modified) {
await sql.doInTransaction(async () => {
await sql.replace("notes", entity);
await sql.remove("links", entity.note_id);
for (const link of links) {
delete link['lnk_id'];
//await sql.insert('link', link);
}
await sync_table.addNoteSync(entity.note_id, sourceId);
await eventLog.addNoteEvent(entity.note_id, "Synced note <note>");
});