add order for category

This commit is contained in:
2026-01-05 11:28:36 +03:30
parent 2f4356e8da
commit f4dd09f7a6
4 changed files with 20 additions and 1 deletions
+8 -1
View File
@@ -1,4 +1,4 @@
import { IsString, IsOptional, IsBoolean } from 'class-validator';
import { IsString, IsOptional, IsBoolean, IsInt, Min } from 'class-validator';
import { ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';
@@ -17,4 +17,11 @@ export class CreateCategoryDto {
@IsString()
@ApiPropertyOptional({ example: 'https://cdn.example.com/avatar.png' })
avatarUrl?: string;
@IsOptional()
@IsInt()
@Min(0)
@Type(() => Number)
@ApiPropertyOptional({ example: 1 })
order?: number;
}