fix: backTest
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
16ad082967
commit
3805812aba
|
@ -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(
|
||||||
|
|
|
@ -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};
|
||||||
|
|
Loading…
Reference in New Issue