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 <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-06-11 19:40:37 +02:00
parent bb355feddc
commit c25c0fac92

View file

@ -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);
}
}