fix: merge new order queue
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

pull/115/head 1.2.7-alpha.4
shancheas 2024-11-20 17:41:29 +07:00
parent 1148a72481
commit 5988a592ac
2 changed files with 4 additions and 1 deletions

View File

@ -58,6 +58,7 @@ export class TicketDataService extends BaseDataService<QueueTicket> {
const end = moment().endOf('day').valueOf();
return this.repo.findOne({
relations: ['items'],
where: {
customer: user,
phone: phone,

View File

@ -71,9 +71,11 @@ export class QueueTransactionHandler
const insertTickets = [];
if (customer_name && customer_phone && existTicket) {
existTicket.items.push(...items);
await this.ticketService.updateQueueTicket(existTicket);
existTicket.items = items;
insertTickets.push(existTicket);
await this.ticketService.updateQueueTicket(existTicket);
} else {
const ticket: QueueTicket = { ...customerOrder, items };
const order: QueueOrder = { ...customerOrder, tickets: [ticket] };