mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 07:04:45 -04:00
chore: add alias dtos
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
36c63d3e40
commit
1fd15cc376
3 changed files with 69 additions and 0 deletions
23
src/notes/alias-create.dto.ts
Normal file
23
src/notes/alias-create.dto.ts
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
|
import { IsString } from 'class-validator';
|
||||||
|
|
||||||
|
export class AliasCreateDto {
|
||||||
|
/**
|
||||||
|
* The note id or alias, which identifies the note the alias should be added to
|
||||||
|
*/
|
||||||
|
@IsString()
|
||||||
|
@ApiProperty()
|
||||||
|
noteIdOrAlias: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The new alias
|
||||||
|
*/
|
||||||
|
@IsString()
|
||||||
|
@ApiProperty()
|
||||||
|
newAlias: string;
|
||||||
|
}
|
16
src/notes/alias-update.dto.ts
Normal file
16
src/notes/alias-update.dto.ts
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
|
import { IsBoolean } from 'class-validator';
|
||||||
|
|
||||||
|
export class AliasUpdateDto {
|
||||||
|
/**
|
||||||
|
* Whether the alias should become the primary alias or not
|
||||||
|
*/
|
||||||
|
@IsBoolean()
|
||||||
|
@ApiProperty()
|
||||||
|
primaryAlias: boolean;
|
||||||
|
}
|
30
src/notes/alias.dto.ts
Normal file
30
src/notes/alias.dto.ts
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
|
import { IsBoolean, IsString } from 'class-validator';
|
||||||
|
|
||||||
|
export class AliasDto {
|
||||||
|
/**
|
||||||
|
* The name of the alias
|
||||||
|
*/
|
||||||
|
@IsString()
|
||||||
|
@ApiProperty()
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the alias the primary alias or not
|
||||||
|
*/
|
||||||
|
@IsBoolean()
|
||||||
|
@ApiProperty()
|
||||||
|
primaryAlias: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The public id of the note the alias is associated with
|
||||||
|
*/
|
||||||
|
@IsString()
|
||||||
|
@ApiProperty()
|
||||||
|
noteId: string;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue