mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 01:35:18 -04:00
Add DTOs for revision and revision metadata
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
9a545bb394
commit
783d2cf5e4
2 changed files with 24 additions and 0 deletions
13
src/revisions/revision-metadata.dto.ts
Normal file
13
src/revisions/revision-metadata.dto.ts
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
import { IsDate, IsNumber, IsString } from 'class-validator';
|
||||||
|
import { Revision } from './revision.entity';
|
||||||
|
|
||||||
|
export class RevisionMetadataDto {
|
||||||
|
@IsString()
|
||||||
|
id: Revision['id'];
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
updatedAt: Date;
|
||||||
|
|
||||||
|
@IsNumber()
|
||||||
|
length: number;
|
||||||
|
}
|
11
src/revisions/revision.dto.ts
Normal file
11
src/revisions/revision.dto.ts
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import { IsString } from 'class-validator';
|
||||||
|
import { Revision } from './revision.entity';
|
||||||
|
|
||||||
|
export class RevisionDto {
|
||||||
|
@IsString()
|
||||||
|
id: Revision['id'];
|
||||||
|
@IsString()
|
||||||
|
content: string;
|
||||||
|
@IsString()
|
||||||
|
patch: string;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue