diff --git a/modules/ticket/back/methods/ticket/transferSales.js b/modules/ticket/back/methods/ticket/transferSales.js index ae9000834..815d5fb4b 100644 --- a/modules/ticket/back/methods/ticket/transferSales.js +++ b/modules/ticket/back/methods/ticket/transferSales.js @@ -162,6 +162,7 @@ module.exports = Self => { if (sale.quantity > originalSale.quantity) throw new UserError('Invalid quantity'); + // Update original sale const rest = originalSale.quantity - sale.quantity; const updatedSale = await models.Sale.updateAll({ @@ -173,7 +174,7 @@ module.exports = Self => { newSale.ticketFk = ticketId; newSale.quantity = sale.quantity; - await models.Sale.create(newSale, options); + const createdSale = await models.Sale.create(newSale, options); // Clone sale components const saleComponents = await models.SaleComponent.find({ @@ -187,6 +188,6 @@ module.exports = Self => { await models.SaleComponent.create(newComponents, options); - return [updatedSale, createdSale]; + return updatedSale; } };