fix: warmFix setDeleted checks ticketRequest not answered
This commit is contained in:
parent
81e461d7b1
commit
143930bc86
|
@ -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)
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue