fix: backTest
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2023-06-07 07:43:44 +02:00
parent 16ad082967
commit 3805812aba
2 changed files with 3 additions and 3 deletions

View File

@ -48,7 +48,7 @@ module.exports = Self => {
try { try {
let buy = await models.Buy.findOne({where: {entryFk: args.id}}, myOptions); let buy = await models.Buy.findOne({where: {entryFk: args.id}}, myOptions);
if (buy) if (buy)
await buy.updateAttribute('printedStickers', args.printedStickers); await buy.updateAttribute('printedStickers', args.printedStickers, myOptions);
else { else {
const userConfig = await models.UserConfig.findById(userId, {fields: ['warehouseFk']}, myOptions); const userConfig = await models.UserConfig.findById(userId, {fields: ['warehouseFk']}, myOptions);
await Self.rawSql( await Self.rawSql(

View File

@ -4,9 +4,9 @@ describe('entry addFromBuy()', () => {
const ctx = {req: {accessToken: {userId: 18}}}; const ctx = {req: {accessToken: {userId: 18}}};
it('should change the printedStickers of an existent buy', async() => { it('should change the printedStickers of an existent buy', async() => {
const id = 2; const id = 1;
const item = 1; const item = 1;
const buy = 2; const buy = 1;
const tx = await models.Entry.beginTransaction({}); const tx = await models.Entry.beginTransaction({});
const options = {transaction: tx}; const options = {transaction: tx};