From c25c0fac922facd288e661d2b1de343e0d18bad8 Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Sun, 11 Jun 2023 19:40:37 +0200 Subject: [PATCH] fix: don't save revisions on creation sometimes we create revisions for notes that don't exist yet. If we try to persist a revision that is referring to a non-existing note the whole attempt crashes. Signed-off-by: Tilman Vatteroth --- backend/src/revisions/revisions.service.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/src/revisions/revisions.service.ts b/backend/src/revisions/revisions.service.ts index 93bbddfe9..2607dce95 100644 --- a/backend/src/revisions/revisions.service.ts +++ b/backend/src/revisions/revisions.service.ts @@ -175,7 +175,7 @@ export class RevisionsService { return entity; }); - const revision = Revision.create( + return Revision.create( newContent, patch, note, @@ -184,6 +184,5 @@ export class RevisionsService { description, tagEntities, ) as Revision; - return await this.revisionRepository.save(revision); } }