feat(revision): include length in dto

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2022-02-13 19:30:15 +01:00
parent 7050c9f13b
commit 3ea42fb048
2 changed files with 9 additions and 0 deletions

View file

@ -28,6 +28,14 @@ export class RevisionDto extends BaseDto {
@ApiProperty() @ApiProperty()
content: string; content: string;
/**
* Number of characters in this revision
* @example 142
*/
@IsNumber()
@ApiProperty()
length: number;
/** /**
* Patch from the preceding revision to this one * Patch from the preceding revision to this one
*/ */

View file

@ -115,6 +115,7 @@ export class RevisionsService {
return { return {
id: revision.id, id: revision.id,
content: revision.content, content: revision.content,
length: revision.length,
createdAt: revision.createdAt, createdAt: revision.createdAt,
patch: revision.patch, patch: revision.patch,
edits: await Promise.all( edits: await Promise.all(