[Response Ops][Cases] Define a better type for useFetchAlertData hooks #124048
Labels
Feature:Cases
Cases feature
Team:ResponseOps
Label for the ResponseOps team (formerly the Cases and Alerting teams)
technical debt
Improvement of the software architecture and operational architecture
The
useFetchAlertData
hooks defined for security solution and observability will returnRecord<string, unknown>
when this PR is merged: #123883Ideally we could help the recipient by returning a more definitive type. The issue is that security solution's implementation recursively breaks the results up into a nested object here:
https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/public/cases/pages/use_fetch_alert_data.ts#L30
https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/public/common/utils/alerts.ts#L128
where as the observability function does not. It simply returns the data the way the alerts client sends it which looks more like:
Alerts client response
Observability formatted result
The text was updated successfully, but these errors were encountered: