add printFormCreatedAt
This commit is contained in:
@@ -240,11 +240,7 @@ export class OrderService {
|
||||
|
||||
const orderItem = await this.findOrderItemOrFail(orderId, itemId)
|
||||
|
||||
const updated = await this.updateOrderItem(orderItem, dto)
|
||||
|
||||
// await this.calculateOrder(undefined, orderId)
|
||||
|
||||
// await this.em.flush()
|
||||
const updated = await this.updateOrderItem(orderItem, { ...dto, printFormCreatedAt: new Date() })
|
||||
|
||||
return updated
|
||||
}
|
||||
@@ -372,7 +368,6 @@ export class OrderService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
async removeOrderAsUser(userId: string, orderId: string) {
|
||||
const order = await this.findOrderOrFail(orderId)
|
||||
|
||||
@@ -415,7 +410,7 @@ export class OrderService {
|
||||
|
||||
private async createOrderItemEntity(order: Order, dto: CreateOrderItemPopulated, em?: EntityManager) {
|
||||
const { attributes, description, quantity, attachments, discount,
|
||||
unitPrice, product, designer, printAttributes, printAttachments } = dto
|
||||
unitPrice, product, designer, printAttributes } = dto
|
||||
|
||||
const eM = em ?? this.em
|
||||
return eM.create(
|
||||
@@ -431,7 +426,6 @@ export class OrderService {
|
||||
unitPrice,
|
||||
product,
|
||||
printAttributes: printAttributes,
|
||||
// printAttachments
|
||||
})
|
||||
}
|
||||
|
||||
@@ -540,8 +534,8 @@ export class OrderService {
|
||||
}
|
||||
|
||||
async updateOrderItem(orderItem: OrderItem, dto: UpdateOrderItem) {
|
||||
const { attributes, description, product, quantity,
|
||||
attachments, discount, unitPrice, designer, printAttributes, printAttachments } = dto
|
||||
const { attributes, description, product, quantity, printFormCreatedAt,
|
||||
attachments, discount, unitPrice, designer, printAttributes, } = dto
|
||||
|
||||
if (product && orderItem.product.id !== product.id) {
|
||||
orderItem.product = product
|
||||
@@ -573,6 +567,10 @@ export class OrderService {
|
||||
orderItem.unitPrice = unitPrice
|
||||
}
|
||||
|
||||
if (printFormCreatedAt != undefined) {
|
||||
orderItem.printFormCreatedAt = printFormCreatedAt
|
||||
}
|
||||
|
||||
if (printAttributes != undefined) {
|
||||
orderItem.printAttributes = printAttributes
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user