Permalink
Browse files

fix(dao): Map troubleTicketState properly (JS-24)

  • Loading branch information...
mvrueden committed Aug 29, 2017
1 parent 1325c5e commit 86fc2986e7ea8a6b581e7a1ebb6908107670cabc
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/dao/AlarmDAO.ts
View
@@ -342,8 +342,13 @@ export class AlarmDAO extends AbstractDAO<number, OnmsAlarm> {
alarm.type = AlarmTypes[type];
}
if (data.troubleTicketState) {
alarm.troubleTicketState = TroubleTicketStates[data.troubleTicketState];
if (typeof data.troubleTicketState !== 'undefined') {
const troubleTicketKey = Object.keys(TroubleTicketStates).find((key) => {
return TroubleTicketStates[key].id === data.troubleTicketState;
});
if (troubleTicketKey) {
alarm.troubleTicketState = TroubleTicketStates[troubleTicketKey];
}
}
if (data.serviceType) {

0 comments on commit 86fc298

Please sign in to comment.