fix(web): handle undefined values in incident transform
This commit is contained in:
@@ -90,13 +90,12 @@ function transformIncident(raw: RawIncident): Incident {
|
|||||||
priority: (raw.priority || 'medium') as IncidentPriority,
|
priority: (raw.priority || 'medium') as IncidentPriority,
|
||||||
escalationLevel: (raw.escalation_level || 'microdao') as EscalationLevel,
|
escalationLevel: (raw.escalation_level || 'microdao') as EscalationLevel,
|
||||||
targetScopeType: (raw.scope_type || 'city') as TargetScopeType,
|
targetScopeType: (raw.scope_type || 'city') as TargetScopeType,
|
||||||
targetScopeId: raw.scope_id,
|
targetScopeId: raw.scope_id || 'unknown',
|
||||||
createdByDaisId: raw.reporter_id,
|
createdByDaisId: raw.reporter_id || 'unknown',
|
||||||
createdByName: raw.reporter_name,
|
|
||||||
assignedToDaisId: raw.assigned_to,
|
assignedToDaisId: raw.assigned_to,
|
||||||
assignedToName: raw.assignee_name,
|
metadata: {},
|
||||||
createdAt: raw.created_at,
|
createdAt: raw.created_at || new Date().toISOString(),
|
||||||
updatedAt: raw.updated_at,
|
updatedAt: raw.updated_at || new Date().toISOString(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user