From 16ad0829671db9fa21bd6e011976f0cf786055f2 Mon Sep 17 00:00:00 2001 From: alexandre Date: Wed, 7 Jun 2023 07:36:30 +0200 Subject: [PATCH 1/2] back fixed --- modules/entry/back/methods/entry/specs/addFromBuy.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/entry/back/methods/entry/specs/addFromBuy.spec.js b/modules/entry/back/methods/entry/specs/addFromBuy.spec.js index b6ed475b3..d2b79c601 100644 --- a/modules/entry/back/methods/entry/specs/addFromBuy.spec.js +++ b/modules/entry/back/methods/entry/specs/addFromBuy.spec.js @@ -4,9 +4,9 @@ describe('entry addFromBuy()', () => { const ctx = {req: {accessToken: {userId: 18}}}; it('should change the printedStickers of an existent buy', async() => { - const id = 1; + const id = 2; const item = 1; - const buy = 1; + const buy = 2; const tx = await models.Entry.beginTransaction({}); const options = {transaction: tx}; -- 2.40.1 From 3805812aba9a7ce12fd2a3a85bd49398c02c6a8b Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 7 Jun 2023 07:43:44 +0200 Subject: [PATCH 2/2] fix: backTest --- modules/entry/back/methods/entry/addFromBuy.js | 2 +- modules/entry/back/methods/entry/specs/addFromBuy.spec.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/entry/back/methods/entry/addFromBuy.js b/modules/entry/back/methods/entry/addFromBuy.js index a40dd3412..f7e1b637e 100644 --- a/modules/entry/back/methods/entry/addFromBuy.js +++ b/modules/entry/back/methods/entry/addFromBuy.js @@ -48,7 +48,7 @@ module.exports = Self => { try { let buy = await models.Buy.findOne({where: {entryFk: args.id}}, myOptions); if (buy) - await buy.updateAttribute('printedStickers', args.printedStickers); + await buy.updateAttribute('printedStickers', args.printedStickers, myOptions); else { const userConfig = await models.UserConfig.findById(userId, {fields: ['warehouseFk']}, myOptions); await Self.rawSql( diff --git a/modules/entry/back/methods/entry/specs/addFromBuy.spec.js b/modules/entry/back/methods/entry/specs/addFromBuy.spec.js index d2b79c601..b6ed475b3 100644 --- a/modules/entry/back/methods/entry/specs/addFromBuy.spec.js +++ b/modules/entry/back/methods/entry/specs/addFromBuy.spec.js @@ -4,9 +4,9 @@ describe('entry addFromBuy()', () => { const ctx = {req: {accessToken: {userId: 18}}}; it('should change the printedStickers of an existent buy', async() => { - const id = 2; + const id = 1; const item = 1; - const buy = 2; + const buy = 1; const tx = await models.Entry.beginTransaction({}); const options = {transaction: tx}; -- 2.40.1