feat(revision): include edits in dto

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2022-02-13 19:07:52 +01:00
parent 50c8f39c0c
commit 7050c9f13b
7 changed files with 48 additions and 6 deletions

View file

@ -5,9 +5,10 @@
*/
import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsDate, IsNumber, IsString } from 'class-validator';
import { IsDate, IsNumber, 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 {
@ -42,4 +43,11 @@ export class RevisionDto extends BaseDto {
@Type(() => Date)
@ApiProperty()
createdAt: Date;
/**
* All edit objects which are used in the revision.
*/
@ValidateNested()
@ApiProperty()
edits: EditDto[];
}