diff --git a/src/revisions/revision.entity.ts b/src/revisions/revision.entity.ts index 4427454e2..2c15515af 100644 --- a/src/revisions/revision.entity.ts +++ b/src/revisions/revision.entity.ts @@ -65,4 +65,15 @@ export class Revision { ) @JoinTable() 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; + } }