#6964 _ itemOlder #2197
|
@ -53,7 +53,7 @@ module.exports = Self => {
|
|||
AND (p.code <> ? OR ? IS NULL)
|
||||
AND (ish.shelvingFk <> ? OR ? IS NULL)
|
||||
sergiodt marked this conversation as resolved
Outdated
|
||||
AND (ish.itemFk <> ? OR ? IS NULL)`,
|
||||
sergiodt marked this conversation as resolved
Outdated
alexm
commented
Si li poses el alias aci hi ha que canviarlo Si li poses el alias aci hi ha que canviarlo
|
||||
[shelvingFkIn, parking, parking, shelvingFkOut, shelvingFkOut, itemFk, itemFk]);
|
||||
[shelvingFkIn, parking, parking, shelvingFkOut, shelvingFkOut, itemFk, itemFk], options);
|
||||
sergiodt marked this conversation as resolved
Outdated
alexm
commented
Aci Aci
alexm
commented
myOptions myOptions
|
||||
return result[0]['countItemOlder'] > 0;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -5,7 +5,7 @@ describe('itemShelving hasOlder()', () => {
|
|||
it('should return false because there are not older items', async() => {
|
||||
const shelvingFkIn = 'GVC';
|
||||
const shelvingFkOut = 'HEJ';
|
||||
const result = await models.ItemShelving.hasItemOlder(shelvingFkIn, shelvingFkOut);
|
||||
const result = await models.ItemShelving.hasItemOlder(shelvingFkIn, null, shelvingFkOut);
|
||||
sergiodt marked this conversation as resolved
Outdated
alexm
commented
Al cridar a la funcio hi ha que seguir el mateix ordre que dalt ( Per tant seria Al cridar a la funcio hi ha que seguir el mateix ordre que dalt (`async(shelvingFkIn, parking, shelvingFkOut, itemFk, options`)
Per tant seria `await models.ItemShelving.hasItemOlder(shelvingFkIn, null, shelvingFkOut)`
|
||||
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
|
@ -33,7 +33,7 @@ describe('itemShelving hasOlder()', () => {
|
|||
await itemShelvingBefore.updateAttributes({
|
||||
itemFk: itemFk
|
||||
sergiodt marked this conversation as resolved
alexm
commented
, myOptions , myOptions
|
||||
});
|
||||
sergiodt marked this conversation as resolved
Outdated
alexm
commented
, myOptions , myOptions
|
||||
const result = await models.ItemShelving.hasItemOlder(shelvingFkIn, parking);
|
||||
const result = await models.ItemShelving.hasItemOlder(shelvingFkIn, parking, null, null, myOptions);
|
||||
sergiodt marked this conversation as resolved
Outdated
alexm
commented
Aci deuries gastar la transaccio Aci deuries gastar la transaccio
await models.ItemShelving.hasItemOlder(shelvingFkIn, parking, null, null, myOptions)
sergiodt
commented
Ací si que veig que faltava posar myOptions perquè faig més accions Ací si que veig que faltava posar myOptions perquè faig més accions
|
||||
|
||||
expect(result).toBe(true);
|
||||
await tx.rollback();
|
||||
|
|
Loading…
Reference in New Issue
falta gastar la transaccio (...shelvingFkOut, itemFk, itemFk], options)
Llevat options
Es ficarlo sino no gastarà la transaccio
L'he posat però no veia que fera falta...