fix(user-service): add class-validator decorators to auth DTOs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
f87c089ca2
commit
3efce36f92
|
|
@ -6,22 +6,34 @@ import {
|
||||||
HttpCode,
|
HttpCode,
|
||||||
HttpStatus,
|
HttpStatus,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
|
import { IsString, IsNotEmpty, IsOptional } from 'class-validator';
|
||||||
import { AuthService } from './auth.service';
|
import { AuthService } from './auth.service';
|
||||||
|
|
||||||
class CreateAnonymousDto {
|
class CreateAnonymousDto {
|
||||||
fingerprint: string;
|
@IsOptional()
|
||||||
|
@IsString()
|
||||||
|
fingerprint?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
class SendCodeDto {
|
class SendCodeDto {
|
||||||
|
@IsNotEmpty()
|
||||||
|
@IsString()
|
||||||
phone: string;
|
phone: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
class VerifyCodeDto {
|
class VerifyCodeDto {
|
||||||
|
@IsNotEmpty()
|
||||||
|
@IsString()
|
||||||
phone: string;
|
phone: string;
|
||||||
|
|
||||||
|
@IsNotEmpty()
|
||||||
|
@IsString()
|
||||||
code: string;
|
code: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
class RefreshTokenDto {
|
class RefreshTokenDto {
|
||||||
|
@IsNotEmpty()
|
||||||
|
@IsString()
|
||||||
token: string;
|
token: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue