mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-17 00:24:43 -04:00
Add NoteModule
This contains the module, a model which was adapted from the old code and two DTOs. Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
35674e80c4
commit
69afdd3b05
6 changed files with 196 additions and 1 deletions
36
src/notes/note-metadata.dto.ts
Normal file
36
src/notes/note-metadata.dto.ts
Normal file
|
@ -0,0 +1,36 @@
|
|||
import {
|
||||
IsArray,
|
||||
IsDate,
|
||||
IsNumber,
|
||||
IsString,
|
||||
ValidateNested,
|
||||
} from 'class-validator';
|
||||
import { UserInfoDto } from '../users/user-info.dto';
|
||||
import { NotePermissionsDto } from './note-permissions.dto';
|
||||
|
||||
export class NoteMetadataDto {
|
||||
@IsString()
|
||||
id: string;
|
||||
@IsString()
|
||||
alias: string;
|
||||
@IsString()
|
||||
title: string;
|
||||
@IsString()
|
||||
description: string;
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
tags: string[];
|
||||
@IsDate()
|
||||
updateTime: Date;
|
||||
@ValidateNested()
|
||||
updateUser: UserInfoDto;
|
||||
@IsNumber()
|
||||
viewCount: number;
|
||||
@IsDate()
|
||||
createTime: Date;
|
||||
@IsArray()
|
||||
@ValidateNested()
|
||||
editedBy: UserInfoDto['userName'][];
|
||||
@ValidateNested()
|
||||
permission: NotePermissionsDto;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue