2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 11:36:44 +00:00

[Plugins] Pass queryClient through to plugin (#8486)

This commit is contained in:
Oliver 2024-11-15 17:31:47 +11:00 committed by GitHub
parent 7a3bed5b40
commit b5599c91ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,7 +8,8 @@ import type { AxiosInstance } from 'axios';
import { useMemo } from 'react';
import { type NavigateFunction, useNavigate } from 'react-router-dom';
import { api } from '../../App';
import type { QueryClient } from '@tanstack/react-query';
import { api, queryClient } from '../../App';
import { useLocalState } from '../../states/LocalState';
import {
type SettingsStateProps,
@ -32,6 +33,7 @@ import { type UserStateProps, useUserState } from '../../states/UserState';
*/
export type InvenTreeContext = {
api: AxiosInstance;
queryClient: QueryClient;
user: UserStateProps;
userSettings: SettingsStateProps;
globalSettings: SettingsStateProps;
@ -56,6 +58,7 @@ export const useInvenTreeContext = () => {
user: user,
host: host,
api: api,
queryClient: queryClient,
navigate: navigate,
globalSettings: globalSettings,
userSettings: userSettings,
@ -66,6 +69,7 @@ export const useInvenTreeContext = () => {
user,
host,
api,
queryClient,
navigate,
globalSettings,
userSettings,