product bug
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user