mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 00:54:43 -04:00
RevisionEntity: Add create()
method
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
32a6396a50
commit
58e2932c1a
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…
Add table
Add a link
Reference in a new issue