mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 09:45:37 -04:00
EditDto: Clarify that the username can be null
If the edit was made by a anonymous user, we don't have a username. Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
09329ae360
commit
57d1fc12bf
1 changed files with 6 additions and 4 deletions
|
@ -4,18 +4,20 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { IsDate, IsNumber, IsString, Min } from 'class-validator';
|
import { IsDate, IsNumber, IsOptional, IsString, Min } from 'class-validator';
|
||||||
import { UserInfoDto } from '../users/user-info.dto';
|
import { UserInfoDto } from '../users/user-info.dto';
|
||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||||
|
|
||||||
export class EditDto {
|
export class EditDto {
|
||||||
/**
|
/**
|
||||||
* Username of the user who authored this section
|
* Username of the user who authored this section
|
||||||
|
* Is `null` if the user is anonymous
|
||||||
* @example "john.smith"
|
* @example "john.smith"
|
||||||
*/
|
*/
|
||||||
@IsString()
|
@IsString()
|
||||||
@ApiProperty()
|
@IsOptional()
|
||||||
userName: UserInfoDto['userName'];
|
@ApiPropertyOptional()
|
||||||
|
userName: UserInfoDto['userName'] | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Character index of the start of this section
|
* Character index of the start of this section
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue