From 2950c5eaa4ad6424d1cba8ee20a6e3c8d816d6f4 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Sun, 10 Aug 2025 04:53:27 +0000 Subject: [PATCH 1/2] feat(etapi): also save note revision via etapi if needed too asdf --- apps/server/src/etapi/notes.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/server/src/etapi/notes.ts b/apps/server/src/etapi/notes.ts index 973ec04af..e7a1c0a1c 100644 --- a/apps/server/src/etapi/notes.ts +++ b/apps/server/src/etapi/notes.ts @@ -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.`); } + noteService.saveRevisionIfNeeded(note); eu.validateAndPatch(note, req.body, ALLOWED_PROPERTIES_FOR_PATCH); 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.`); } + noteService.saveRevisionIfNeeded(note); note.setContent(req.body); noteService.asyncPostProcessContent(note, req.body); From e7fd9371b6b1155a66766f249900a00a67327459 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 13 Aug 2025 19:22:48 +0300 Subject: [PATCH 2/2] test(etapi): variable shadowing causing spurious error --- apps/server/spec/etapi/patch-note.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/spec/etapi/patch-note.spec.ts b/apps/server/spec/etapi/patch-note.spec.ts index 178808762..3d6a9cd59 100644 --- a/apps/server/spec/etapi/patch-note.spec.ts +++ b/apps/server/spec/etapi/patch-note.spec.ts @@ -29,7 +29,7 @@ describe("etapi/patch-note", () => { }) .expect(201); - const createdNoteId = response.body.note.noteId as string; + createdNoteId = response.body.note.noteId as string; expect(createdNoteId).toBeTruthy(); });