mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
feat(etapi): also save note revision via etapi if needed too
asdf
This commit is contained in:
parent
78bb0ab016
commit
2950c5eaa4
@ -92,6 +92,7 @@ function register(router: Router) {
|
|||||||
throw new eu.EtapiError(400, "NOTE_IS_PROTECTED", `Note '${req.params.noteId}' is protected and cannot be modified through ETAPI.`);
|
throw new eu.EtapiError(400, "NOTE_IS_PROTECTED", `Note '${req.params.noteId}' is protected and cannot be modified through ETAPI.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
noteService.saveRevisionIfNeeded(note);
|
||||||
eu.validateAndPatch(note, req.body, ALLOWED_PROPERTIES_FOR_PATCH);
|
eu.validateAndPatch(note, req.body, ALLOWED_PROPERTIES_FOR_PATCH);
|
||||||
note.save();
|
note.save();
|
||||||
|
|
||||||
@ -136,6 +137,7 @@ function register(router: Router) {
|
|||||||
throw new eu.EtapiError(400, "NOTE_IS_PROTECTED", `Note '${req.params.noteId}' is protected and cannot be modified through ETAPI.`);
|
throw new eu.EtapiError(400, "NOTE_IS_PROTECTED", `Note '${req.params.noteId}' is protected and cannot be modified through ETAPI.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
noteService.saveRevisionIfNeeded(note);
|
||||||
note.setContent(req.body);
|
note.setContent(req.body);
|
||||||
|
|
||||||
noteService.asyncPostProcessContent(note, req.body);
|
noteService.asyncPostProcessContent(note, req.body);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user