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