This commit is contained in:
@@ -202,6 +202,13 @@ export class OrderService {
|
|||||||
order.product = product;
|
order.product = product;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (dto.designerId !== undefined) {
|
||||||
|
if (dto.designerId == null || dto.designerId === '') {
|
||||||
|
order.designer = undefined;
|
||||||
|
} else {
|
||||||
|
order.designer = await this.adminService.findOrFail(dto.designerId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await this.em.flush();
|
await this.em.flush();
|
||||||
return order;
|
return order;
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import {
|
|||||||
IsBoolean,
|
IsBoolean,
|
||||||
IsInt,
|
IsInt,
|
||||||
IsNotEmpty,
|
IsNotEmpty,
|
||||||
IsNumber,
|
|
||||||
IsOptional,
|
IsOptional,
|
||||||
IsString,
|
IsString,
|
||||||
Min,
|
Min,
|
||||||
@@ -32,12 +31,6 @@ export class CreateproductDto {
|
|||||||
@IsOptional()
|
@IsOptional()
|
||||||
linkUrl: string;
|
linkUrl: string;
|
||||||
|
|
||||||
@IsArray()
|
|
||||||
@Type(() => Number)
|
|
||||||
@IsNumber({}, { each: true })
|
|
||||||
@ApiPropertyOptional({ type: [Number] })
|
|
||||||
quantities: number[];
|
|
||||||
|
|
||||||
// @IsOptional()
|
// @IsOptional()
|
||||||
// @IsInt()
|
// @IsInt()
|
||||||
// @Min(0)
|
// @Min(0)
|
||||||
|
|||||||
@@ -16,10 +16,6 @@ export class Product extends BaseEntity {
|
|||||||
@Property({ type: 'string' })
|
@Property({ type: 'string' })
|
||||||
desc: string
|
desc: string
|
||||||
|
|
||||||
@Property({ type: 'json' })
|
|
||||||
quantities: number[]
|
|
||||||
|
|
||||||
|
|
||||||
@Property({ type: 'text', nullable: true })
|
@Property({ type: 'text', nullable: true })
|
||||||
linkUrl?: string;
|
linkUrl?: string;
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ export class ProductService {
|
|||||||
order: rest.order ?? null,
|
order: rest.order ?? null,
|
||||||
title: rest.title,
|
title: rest.title,
|
||||||
desc: rest.desc,
|
desc: rest.desc,
|
||||||
quantities: rest.quantities,
|
|
||||||
images: rest.images ?? undefined,
|
images: rest.images ?? undefined,
|
||||||
linkUrl: rest.linkUrl,
|
linkUrl: rest.linkUrl,
|
||||||
category,
|
category,
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ export class ProductsSeeder {
|
|||||||
category,
|
category,
|
||||||
isActive: productData.isActive,
|
isActive: productData.isActive,
|
||||||
// prepareTime: 10,
|
// prepareTime: 10,
|
||||||
quantities: [100, 200],
|
|
||||||
images: productData.images,
|
images: productData.images,
|
||||||
order: 1
|
order: 1
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user