mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 01:36:29 -05:00
Add DTOs for revision and revision metadata
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
b429326b9d
commit
b8af7301a1
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…
Reference in a new issue