mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-02-18 03:51:16 +00:00
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:
parent
bb355feddc
commit
c25c0fac92
1 changed files with 1 additions and 2 deletions
|
@ -175,7 +175,7 @@ export class RevisionsService {
|
||||||
return entity;
|
return entity;
|
||||||
});
|
});
|
||||||
|
|
||||||
const revision = Revision.create(
|
return Revision.create(
|
||||||
newContent,
|
newContent,
|
||||||
patch,
|
patch,
|
||||||
note,
|
note,
|
||||||
|
@ -184,6 +184,5 @@ export class RevisionsService {
|
||||||
description,
|
description,
|
||||||
tagEntities,
|
tagEntities,
|
||||||
) as Revision;
|
) as Revision;
|
||||||
return await this.revisionRepository.save(revision);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue