resolved bug with alert level nonexistent
This commit is contained in:
parent
2e8f8109e7
commit
7853236f2b
|
@ -20,9 +20,10 @@ module.exports = Self => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.isEditable = async ticketFk => {
|
Self.isEditable = async ticketFk => {
|
||||||
let state = await Self.app.models.TicketState.findOne({where: {ticketFk: ticketFk}, fields: 'alertLevel'});
|
let state = await Self.app.models.TicketState.findOne({where: {ticketFk: ticketFk}});
|
||||||
|
let alertLevel = state ? state.alertLevel : null;
|
||||||
let exists = await Self.app.models.Ticket.findOne({where: {id: ticketFk}, fields: 'isDeleted'});
|
let exists = await Self.app.models.Ticket.findOne({where: {id: ticketFk}, fields: 'isDeleted'});
|
||||||
if (!exists || exists.isDeleted == 1 || state.alertLevel > 0)
|
if (!exists || exists.isDeleted == 1 || (alertLevel && alertLevel > 0))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue