7152-devToTest_2414 #2228
|
@ -16,7 +16,6 @@ module.exports = Self => {
|
|||
Self.assignCollection = async(ctx, options) => {
|
||||
const userId = ctx.req.accessToken.userId;
|
||||
const myOptions = {userId};
|
||||
const $t = ctx.req.__;
|
||||
|
||||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
@ -26,7 +25,7 @@ module.exports = Self => {
|
|||
const [assignedCollection] = await Self.rawSql('SELECT @vCollectionFk');
|
||||
const {'@vCollectionFk': collectionFk} = assignedCollection;
|
||||
|
||||
if (!collectionFk) throw new UserError($t('There are not picking tickets'));
|
||||
if (!collectionFk) throw new UserError('There are not picking tickets');
|
||||
await Self.rawSql('CALL vn.collection_printSticker(?, NULL)', [collectionFk], myOptions);
|
||||
|
||||
return collectionFk;
|
||||
|
|
|
@ -29,9 +29,9 @@ module.exports = Self => {
|
|||
let fields = ['id', 'appName'];
|
||||
|
||||
if (workerFk)
|
||||
fields = [...fields, ...['isVersionBetaCritical', 'versionBeta', 'urlBeta']];
|
||||
fields = fields.concat(['isVersionBetaCritical', 'versionBeta', 'urlBeta']);
|
||||
else
|
||||
fields = [...fields, ...['isVersionCritical', 'version', 'urlProduction']];
|
||||
fields = fields.concat(['isVersionCritical', 'version', 'urlProduction']);
|
||||
|
||||
const filter = {
|
||||
where: {
|
||||
|
@ -40,6 +40,6 @@ module.exports = Self => {
|
|||
fields,
|
||||
};
|
||||
|
||||
return await Self.findOne(filter);
|
||||
return Self.findOne(filter);
|
||||
};
|
||||
};
|
||||
|
|
|
@ -36,7 +36,6 @@ module.exports = Self => {
|
|||
fields: ['code'],
|
||||
where: {
|
||||
itemFk: realIdItem
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -50,14 +50,17 @@ describe('ticket setDeleted()', () => {
|
|||
return value;
|
||||
};
|
||||
const ticketId = 23;
|
||||
|
||||
await models.Ticket.setDeleted(ctx, ticketId, options);
|
||||
|
||||
const [sectorCollection] = await models.Ticket.rawSql(
|
||||
const [sectorCollectionBefore] = await models.Ticket.rawSql(
|
||||
`SELECT COUNT(*) numberRows
|
||||
FROM vn.sectorCollection`, [], options);
|
||||
|
||||
expect(sectorCollection.numberRows).toEqual(1);
|
||||
await models.Ticket.setDeleted(ctx, ticketId, options);
|
||||
|
||||
const [sectorCollectionAfter] = await models.Ticket.rawSql(
|
||||
`SELECT COUNT(*) numberRows
|
||||
FROM vn.sectorCollection`, [], options);
|
||||
|
||||
expect(sectorCollectionAfter.numberRows).toEqual(sectorCollectionBefore.numberRows - 1);
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
|
|
|
@ -12,9 +12,6 @@
|
|||
"id": true,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"truckFk": {
|
||||
"type": "number"
|
||||
},
|
||||
"built": {
|
||||
"type": "date"
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue