chore: compelete danak category service
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
||||
import { IsNotEmpty, IsOptional, IsString, IsUUID, IsUrl, Length } from "class-validator";
|
||||
import { IsBoolean, IsNotEmpty, IsOptional, IsString, IsUUID, IsUrl, Length } from "class-validator";
|
||||
|
||||
import { CategoryMessage } from "../../../common/enums/message.enum";
|
||||
|
||||
@@ -15,6 +15,11 @@ export class CreateCategoryDto {
|
||||
@ApiProperty({ description: "Category icon", example: "https://example.com/icon.png" })
|
||||
icon: string;
|
||||
|
||||
@IsNotEmpty({ message: CategoryMessage.IS_ACTIVE_REQUIRED })
|
||||
@IsBoolean({ message: CategoryMessage.IS_ACTIVE_REQUIRED })
|
||||
@ApiProperty({ description: "Category status", example: true })
|
||||
isActive: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@IsNotEmpty({ message: CategoryMessage.PARENT_ID_REQUIRED })
|
||||
@IsUUID("4", { message: CategoryMessage.PARENT_ID_SHOULD_BE_UUID })
|
||||
|
||||
Reference in New Issue
Block a user