diff --git a/src/revisions/revision.dto.ts b/src/revisions/revision.dto.ts index 24033566d..1744230dd 100644 --- a/src/revisions/revision.dto.ts +++ b/src/revisions/revision.dto.ts @@ -4,22 +4,12 @@ * SPDX-License-Identifier: AGPL-3.0-only */ import { ApiProperty } from '@nestjs/swagger'; -import { Type } from 'class-transformer'; -import { IsDate, IsNumber, IsString, ValidateNested } from 'class-validator'; +import { IsString, ValidateNested } from 'class-validator'; -import { BaseDto } from '../utils/base.dto.'; import { EditDto } from './edit.dto'; -import { Revision } from './revision.entity'; - -export class RevisionDto extends BaseDto { - /** - * ID of this revision - * @example 13 - */ - @IsNumber() - @ApiProperty() - id: Revision['id']; +import { RevisionMetadataDto } from './revision-metadata.dto'; +export class RevisionDto extends RevisionMetadataDto { /** * Markdown content of the revision * @example "# I am a heading" @@ -28,14 +18,6 @@ export class RevisionDto extends BaseDto { @ApiProperty() content: string; - /** - * Number of characters in this revision - * @example 142 - */ - @IsNumber() - @ApiProperty() - length: number; - /** * Patch from the preceding revision to this one */ @@ -43,15 +25,6 @@ export class RevisionDto extends BaseDto { @ApiProperty() patch: string; - /** - * Datestring of the time this revision was created - * @example "2020-12-01 12:23:34" - */ - @IsDate() - @Type(() => Date) - @ApiProperty() - createdAt: Date; - /** * All edit objects which are used in the revision. */