product bug

This commit is contained in:
2026-01-24 15:36:07 +03:30
parent bdc76689a5
commit 58e5e3e0d2
5 changed files with 35 additions and 19 deletions
+21 -10
View File
@@ -4,6 +4,7 @@ import {
IsBoolean,
IsInt,
IsNotEmpty,
IsNumber,
IsOptional,
IsString,
Min,
@@ -21,18 +22,28 @@ export class CreateproductDto {
@ApiPropertyOptional({ example: 'کارت ویزیت' })
title: string;
@IsArray()
@IsString({ each: true })
@ApiPropertyOptional({ type: [String] })
desc: string[];
@IsString()
@ApiPropertyOptional()
@IsOptional()
@IsInt()
@Min(0)
desc: string;
@IsString()
@ApiPropertyOptional()
@IsOptional()
linkUrl: string;
@IsArray()
@Type(() => Number)
@ApiPropertyOptional({ example: 15 })
prepareTime?: number;
@IsNumber({}, { each: true })
@ApiPropertyOptional({ type: [Number] })
quantities: number[];
// @IsOptional()
// @IsInt()
// @Min(0)
// @Type(() => Number)
// @ApiPropertyOptional({ example: 15 })
// prepareTime?: number;
@IsOptional()
@IsBoolean()
@@ -18,11 +18,14 @@ export class Product extends BaseEntity {
@Property()
title: string;
@Property({ type: 'json' })
desc: string[]
@Property({ type: 'string' })
desc: string
@Property()
prepareTime: number;
@Property({ type: 'json' })
quantities: number[]
// @Property()
// prepareTime: number;
@Property({ type: 'text', nullable: true })
linkUrl?: string;
@@ -29,7 +29,8 @@ export class ProductService {
order: rest.order ?? null,
title: rest.title,
desc: rest.desc,
prepareTime: rest.prepareTime ?? 0,
// prepareTime: rest.prepareTime ?? 0,
quantities: rest.quantities,
images: rest.images ?? undefined,
category,
};