Skip to content

Commit

Permalink
pass security solution query client to cases context
Browse files Browse the repository at this point in the history
  • Loading branch information
janmonschke committed Oct 16, 2024
1 parent 849a181 commit 84ff56b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion x-pack/plugins/security_solution/public/app/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { FC } from 'react';
import React, { memo, useEffect } from 'react';
import { Router, Routes, Route } from '@kbn/shared-ux-router';
import { useDispatch } from 'react-redux';
import { useQueryClient } from '@tanstack/react-query';

import { APP_ID } from '../../common/constants';
import { RouteCapture } from '../common/components/endpoint/route_capture';
Expand All @@ -30,6 +31,7 @@ const PageRouterComponent: FC<RouterProps> = ({ children, history }) => {
const { cases } = useKibana().services;
const CasesContext = cases.ui.getCasesContext();
const userCasesPermissions = cases.helpers.canUseCases(ownerApp);
const queryClient = useQueryClient();
const dispatch = useDispatch<(action: AppAction) => void>();
useEffect(() => {
return () => {
Expand All @@ -48,7 +50,11 @@ const PageRouterComponent: FC<RouterProps> = ({ children, history }) => {
<RouteCapture>
<Routes>
<Route path="/">
<CasesContext owner={ownerApp} permissions={userCasesPermissions}>
<CasesContext
owner={ownerApp}
permissions={userCasesPermissions}
queryClient={queryClient}
>
<HomePage>{children}</HomePage>
</CasesContext>
</Route>
Expand Down

0 comments on commit 84ff56b

Please sign in to comment.