Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix malformed geo alerts call to transformResults #98094

Merged
merged 16 commits into from
May 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export interface GeoContainmentParams extends AlertTypeParams {
export interface GeoContainmentState extends AlertTypeState {
shapesFilters: Record<string, unknown>;
shapesIdsNamesMap: Record<string, unknown>;
prevLocationMap: Record<string, unknown>;
}
export interface GeoContainmentInstanceState extends AlertInstanceState {
location: number[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
GeoContainmentInstanceState,
GeoContainmentAlertType,
GeoContainmentInstanceContext,
GeoContainmentState,
} from './alert_type';

export type LatestEntityLocation = GeoContainmentInstanceState;
Expand Down Expand Up @@ -141,7 +142,7 @@ export const getGeoContainmentExecutor = (log: Logger): GeoContainmentAlertType[
params,
alertId,
state,
}) {
}): Promise<GeoContainmentState> {
const { shapesFilters, shapesIdsNamesMap } = state.shapesFilters
? state
: await getShapesFilters(
Expand Down Expand Up @@ -176,8 +177,7 @@ export const getGeoContainmentExecutor = (log: Logger): GeoContainmentAlertType[
}

const currLocationMap: Map<string, LatestEntityLocation[]> = transformResults(
// @ts-expect-error body doesn't exist on currentIntervalResults
currentIntervalResults?.body,
currentIntervalResults,
params.dateField,
params.geoField
);
Expand Down
Loading