mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Invalidate queries on update
This commit is contained in:
parent
e80cbdc094
commit
e4ccacac83
2 changed files with 9 additions and 2 deletions
|
@ -4,6 +4,8 @@ import { useQuery } from '@tanstack/react-query';
|
|||
import { useApi } from 'hooks/useApi';
|
||||
import type { AxiosRequestConfig } from 'axios';
|
||||
|
||||
export const QUERY_KEY = 'Configuration';
|
||||
|
||||
export const fetchConfiguration = async (api?: Api, options?: AxiosRequestConfig) => {
|
||||
if (!api) {
|
||||
console.error('[useLogOptions] No API instance available');
|
||||
|
@ -19,7 +21,7 @@ export const useConfiguration = () => {
|
|||
const { api } = useApi();
|
||||
|
||||
return useQuery({
|
||||
queryKey: ['Configuration'],
|
||||
queryKey: [QUERY_KEY],
|
||||
queryFn: ({ signal }) => fetchConfiguration(api, { signal }),
|
||||
enabled: !!api
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue