fix: warmFix setDeleted checks ticketRequest not answered

This commit is contained in:
Javi Gallego 2024-06-05 07:07:13 +02:00
parent 81e461d7b1
commit 143930bc86
2 changed files with 6 additions and 3 deletions

View File

@ -71,7 +71,10 @@ module.exports = Self => {
// Check for existing purchase requests // Check for existing purchase requests
const hasPurchaseRequests = await models.TicketRequest.count({ const hasPurchaseRequests = await models.TicketRequest.count({
ticketFk: id, ticketFk: id,
isOk: true or: [
{isOk: true},
{isOk: null}
]
}, myOptions); }, myOptions);
if (hasPurchaseRequests) if (hasPurchaseRequests)

View File

@ -49,7 +49,7 @@ describe('ticket setDeleted()', () => {
ctx.req.__ = value => { ctx.req.__ = value => {
return value; return value;
}; };
const ticketId = 23; const ticketId = 24;
const [sectorCollectionBefore] = await models.Ticket.rawSql( const [sectorCollectionBefore] = await models.Ticket.rawSql(
`SELECT COUNT(*) numberRows `SELECT COUNT(*) numberRows
FROM vn.sectorCollection`, [], options); FROM vn.sectorCollection`, [], options);
@ -87,7 +87,7 @@ describe('ticket setDeleted()', () => {
const [ticketCollectionOld] = await models.Ticket.rawSql( const [ticketCollectionOld] = await models.Ticket.rawSql(
`SELECT COUNT(*) numberRows `SELECT COUNT(*) numberRows
FROM vn.ticketCollection`, [], options); FROM vn.ticketCollection`, [], options);
const ticketId = 23; const ticketId = 34;
await models.Ticket.setDeleted(ctx, ticketId, options); await models.Ticket.setDeleted(ctx, ticketId, options);