mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 19:47:03 -04:00
refactor: use a base dto class
This gives all dto classes a common super class for usage of the type system. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
0955bf048d
commit
c6bb8f62e8
20 changed files with 86 additions and 43 deletions
|
@ -1,12 +1,14 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 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 {
|
||||
import { BaseDto } from '../utils/base.dto.';
|
||||
|
||||
export class AliasCreateDto extends BaseDto {
|
||||
/**
|
||||
* The note id or alias, which identifies the note the alias should be added to
|
||||
*/
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 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 {
|
||||
import { BaseDto } from '../utils/base.dto.';
|
||||
|
||||
export class AliasUpdateDto extends BaseDto {
|
||||
/**
|
||||
* Whether the alias should become the primary alias or not
|
||||
*/
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 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 {
|
||||
import { BaseDto } from '../utils/base.dto.';
|
||||
|
||||
export class AliasDto extends BaseDto {
|
||||
/**
|
||||
* The name of the alias
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -14,9 +14,10 @@ import {
|
|||
} from 'class-validator';
|
||||
|
||||
import { UserInfoDto } from '../users/user-info.dto';
|
||||
import { BaseDto } from '../utils/base.dto.';
|
||||
import { NotePermissionsDto } from './note-permissions.dto';
|
||||
|
||||
export class NoteMetadataDto {
|
||||
export class NoteMetadataDto extends BaseDto {
|
||||
/**
|
||||
* ID of the note
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -12,7 +12,9 @@ import {
|
|||
ValidateNested,
|
||||
} from 'class-validator';
|
||||
|
||||
export class NoteUserPermissionEntryDto {
|
||||
import { BaseDto } from '../utils/base.dto.';
|
||||
|
||||
export class NoteUserPermissionEntryDto extends BaseDto {
|
||||
/**
|
||||
* Username of the User this permission applies to
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -7,9 +7,10 @@ import { ApiProperty } from '@nestjs/swagger';
|
|||
import { IsArray, IsString, ValidateNested } from 'class-validator';
|
||||
|
||||
import { EditDto } from '../revisions/edit.dto';
|
||||
import { BaseDto } from '../utils/base.dto.';
|
||||
import { NoteMetadataDto } from './note-metadata.dto';
|
||||
|
||||
export class NoteDto {
|
||||
export class NoteDto extends BaseDto {
|
||||
/**
|
||||
* Markdown content of the note
|
||||
* @example "# I am a heading"
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 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 NoteMediaDeletionDto {
|
||||
import { BaseDto } from '../utils/base.dto.';
|
||||
|
||||
export class NoteMediaDeletionDto extends BaseDto {
|
||||
/**
|
||||
* Should the associated mediaUploads be keept
|
||||
* @default false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue