saving attachments when editing

This commit is contained in:
zadam
2023-01-24 09:19:49 +01:00
parent f59e19d93b
commit c474e65cae
9 changed files with 43 additions and 25 deletions

View File

@@ -74,16 +74,16 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
const {note} = this.noteContext;
const {noteId} = note;
const content = await this.getTypeWidget().getContent();
const data = await this.getTypeWidget().getData();
// for read only notes
if (content === undefined) {
if (data === undefined) {
return;
}
protectedSessionHolder.touchProtectedSessionIfNecessary(note);
await server.put(`notes/${noteId}/content`, {content}, this.componentId);
await server.put(`notes/${noteId}/data`, data, this.componentId);
});
appContext.addBeforeUnloadListener(this);