fix: close admin user security gaps
This commit is contained in:
@@ -24,13 +24,13 @@ export class AdminUserProfileDto {
|
||||
}
|
||||
|
||||
export class AdminUserRoleDto {
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@IsIn([RoleEnum.admin, RoleEnum.user])
|
||||
role: RoleEnum;
|
||||
}
|
||||
|
||||
export class AdminUserStatusDto {
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@IsIn([StatusEnum.active, StatusEnum.inactive])
|
||||
status: StatusEnum;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
import { Transform } from 'class-transformer';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Role } from '../../roles/entities/role.entity';
|
||||
import {
|
||||
IsEmail,
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
MinLength,
|
||||
Validate,
|
||||
} from 'class-validator';
|
||||
import { IsEmail, IsNotEmpty, MinLength, Validate } from 'class-validator';
|
||||
import { Status } from '../../statuses/entities/status.entity';
|
||||
import { IsNotExist } from '../../utils/validators/is-not-exists.validator';
|
||||
import { IsExist } from '../../utils/validators/is-exists.validator';
|
||||
@@ -51,6 +45,4 @@ export class CreateUserDto {
|
||||
status?: Status;
|
||||
|
||||
hash?: string | null;
|
||||
|
||||
linkPlayerId?: number | null;
|
||||
}
|
||||
|
||||
11
myteamwallet_backend/src/users/dto/user-team-response.dto.ts
Normal file
11
myteamwallet_backend/src/users/dto/user-team-response.dto.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export class UserTeamReferenceDto {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export class UserTeamPlayerDto {
|
||||
id: number;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
team: UserTeamReferenceDto;
|
||||
}
|
||||
Reference in New Issue
Block a user