feat(dto): enforce field length constraints across DTOs

Add `@MaxLength` validations to limit string field lengths in multiple DTOs, ensuring consistent data validation and integrity. Integrate `CreateApiKeyDto` in the API keys controller for improved type safety.
This commit is contained in:
Mathis HERRIOT
2026-01-14 20:41:45 +01:00
parent 5f2672021e
commit 5671ba60a6
7 changed files with 34 additions and 7 deletions

View File

@@ -1,11 +1,13 @@
import { IsNotEmpty, IsString } from "class-validator";
import { IsNotEmpty, IsString, MaxLength } from "class-validator";
export class UpdateConsentDto {
@IsString()
@IsNotEmpty()
@MaxLength(16)
termsVersion!: string;
@IsString()
@IsNotEmpty()
@MaxLength(16)
privacyVersion!: string;
}