Merge pull request 'refs #3520 hotFix: hasUncheckedTickets' (!2249) from 3520_hotFix-hasUnCheckedTicket into master
gitea/salix/pipeline/head This commit looks good Details
gitea/salix/pipeline/pr-test There was a failure building this commit Details

Reviewed-on: #2249
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Sergio De la torre 2024-04-04 08:43:24 +00:00
commit b0c3f8ef98
2 changed files with 2 additions and 2 deletions

View File

@ -35,6 +35,6 @@ module.exports = Self => {
WHERE tc.ticketFk = ? AND s.order < s2.id WHERE tc.ticketFk = ? AND s.order < s2.id
LIMIT 1;`, LIMIT 1;`,
[ticketFk], myOptions); [ticketFk], myOptions);
return result.length > 0 && result[0]['ticketFk'] > 0; return result[0]?.ticketFk > 0 && result[0].ticketFk;
}; };
}; };

View File

@ -27,7 +27,7 @@ describe('ticketCollection hasUncheckedTicket()', () => {
}, myOptions); }, myOptions);
const result = await models.TicketCollection.hasUncheckedTicket(ticketFk, myOptions); const result = await models.TicketCollection.hasUncheckedTicket(ticketFk, myOptions);
expect(result).toBe(true); expect(result).toBeTruthy();
await tx.rollback(); await tx.rollback();
} catch (e) { } catch (e) {
await tx.rollback(); await tx.rollback();