mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-26 11:43:59 -05: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
|
||||
*/
|
||||
|
||||
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 { ApiProperty } from '@nestjs/swagger';
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
|
||||
export class EditDto {
|
||||
/**
|
||||
* Username of the user who authored this section
|
||||
* Is `null` if the user is anonymous
|
||||
* @example "john.smith"
|
||||
*/
|
||||
@IsString()
|
||||
@ApiProperty()
|
||||
userName: UserInfoDto['userName'];
|
||||
@IsOptional()
|
||||
@ApiPropertyOptional()
|
||||
userName: UserInfoDto['userName'] | null;
|
||||
|
||||
/**
|
||||
* Character index of the start of this section
|
||||
|
|
Loading…
Reference in a new issue