WIP blobs

This commit is contained in:
zadam
2023-03-16 11:02:07 +01:00
parent 5a8e216dec
commit e16bedfab4
30 changed files with 65 additions and 102 deletions

View File

@@ -220,7 +220,7 @@ function createNewNote(params) {
entity: note
});
eventService.emit(eventService.ENTITY_CREATED, {
eventService.emit(eventService.ENTITY_CREATED, { // FIXME
entityName: 'note_contents',
entity: note
});
@@ -499,7 +499,7 @@ function downloadImages(noteId, content) {
asyncPostProcessContent(origNote, updatedContent);
eventService.emit(eventService.ENTITY_CHANGED, {
entityName: 'note_contents',
entityName: 'note_contents', // FIXME
entity: origNote
});
@@ -733,9 +733,6 @@ function eraseNotes(noteIdsToErase) {
sql.executeMany(`DELETE FROM notes WHERE noteId IN (???)`, noteIdsToErase);
setEntityChangesAsErased(sql.getManyRows(`SELECT * FROM entity_changes WHERE entityName = 'notes' AND entityId IN (???)`, noteIdsToErase));
sql.executeMany(`DELETE FROM note_contents WHERE noteId IN (???)`, noteIdsToErase);
setEntityChangesAsErased(sql.getManyRows(`SELECT * FROM entity_changes WHERE entityName = 'note_contents' AND entityId IN (???)`, noteIdsToErase));
// we also need to erase all "dependent" entities of the erased notes
const branchIdsToErase = sql.getManyRows(`SELECT branchId FROM branches WHERE noteId IN (???)`, noteIdsToErase)
.map(row => row.branchId);