fix: test back
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
2d0cb60b50
commit
c33cab7b10
|
@ -110,6 +110,11 @@ describe('sale updateDiscount()', () => {
|
|||
const componentId = manaDiscount.id;
|
||||
const manaCode = 'mana';
|
||||
|
||||
const teamCLopez = 96;
|
||||
const userId = ctx.req.accessToken.userId;
|
||||
const business = await models.Business.findOne({where: {workerFk: userId}}, options);
|
||||
await business.updateAttribute('departmentFk', teamCLopez, options);
|
||||
|
||||
await models.Ticket.updateDiscount(ctx, ticketId, sales, newDiscount, manaCode, options);
|
||||
|
||||
const updatedSale = await models.Sale.findById(originalSaleId, null, options);
|
||||
|
@ -150,6 +155,11 @@ describe('sale updateDiscount()', () => {
|
|||
const componentId = manaDiscount.id;
|
||||
const manaCode = 'manaClaim';
|
||||
|
||||
const teamCLopez = 96;
|
||||
const userId = ctx.req.accessToken.userId;
|
||||
const business = await models.Business.findOne({where: {workerFk: userId}}, options);
|
||||
await business.updateAttribute('departmentFk', teamCLopez, options);
|
||||
|
||||
await models.Ticket.updateDiscount(ctx, ticketId, sales, newDiscount, manaCode, options);
|
||||
|
||||
const updatedSale = await models.Sale.findById(originalSaleId, null, options);
|
||||
|
|
|
@ -98,7 +98,7 @@ module.exports = Self => {
|
|||
if (isLocked || (!hasAllowedRoles && alertLevel > 0))
|
||||
throw new UserError(`The sales of this ticket can't be modified`);
|
||||
|
||||
const usesMana = await models.Sale.usesMana(ctx);
|
||||
const usesMana = await models.Sale.usesMana(ctx, myOptions);
|
||||
const componentCode = usesMana ? manaCode : 'buyerDiscount';
|
||||
const discountComponent = await models.Component.findOne({
|
||||
where: {code: componentCode}}, myOptions);
|
||||
|
|
Loading…
Reference in New Issue