refactor: centralize domain values and enforce numeric lint
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
Delete,
|
||||
Get,
|
||||
HttpCode,
|
||||
HttpStatus,
|
||||
Put,
|
||||
Req,
|
||||
UseGuards,
|
||||
@@ -47,7 +48,7 @@ export class TbankConnectionController {
|
||||
}
|
||||
|
||||
@Delete()
|
||||
@HttpCode(204)
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
@ApiNoContentResponse()
|
||||
delete(@Req() request: Request & { user: AccessPayload }): Promise<void> {
|
||||
return this.connection.delete(request.user.sub);
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsString, MaxLength } from 'class-validator';
|
||||
|
||||
const MAX_TOKEN_LENGTH = 4096;
|
||||
|
||||
export class PutTbankConnectionDto {
|
||||
@ApiProperty({ writeOnly: true })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@MaxLength(4096)
|
||||
@MaxLength(MAX_TOKEN_LENGTH)
|
||||
declare token: string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user