mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-27 12:08:02 -05:00
RevisionEntity: Add create()
method
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
2ab90917bc
commit
5d07481387
1 changed files with 11 additions and 0 deletions
|
@ -65,4 +65,15 @@ export class Revision {
|
||||||
)
|
)
|
||||||
@JoinTable()
|
@JoinTable()
|
||||||
authorships: Authorship[];
|
authorships: Authorship[];
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||||
|
private constructor() {}
|
||||||
|
|
||||||
|
static create(content: string, patch: string): Revision {
|
||||||
|
const newRevision = new Revision();
|
||||||
|
newRevision.patch = patch;
|
||||||
|
newRevision.content = content;
|
||||||
|
newRevision.length = content.length;
|
||||||
|
return newRevision;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue