Hotfix for search refresh
This commit is contained in:
@@ -124,11 +124,17 @@ export function useMutationAPI() {
|
||||
endpoint: string;
|
||||
body: object | undefined | null;
|
||||
}) => callEndpoint(method, endpoint, body),
|
||||
onMutate: () => {
|
||||
queryClient.invalidateQueries();
|
||||
onMutate: ({ method, endpoint }) => {
|
||||
queryClient.resetQueries({
|
||||
queryKey: ['GET', endpoint],
|
||||
force: true,
|
||||
});
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries();
|
||||
onSuccess: (data, { method, endpoint }) => {
|
||||
queryClient.resetQueries({
|
||||
queryKey: ['GET', endpoint],
|
||||
force: true,
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ export default function Search({
|
||||
endpoint: 'api/searchHistory',
|
||||
body: { prefix: providerPrefix, provider: providerLabel, searchTerm: subtext },
|
||||
}).then(() => {
|
||||
open(`${providerURL}${subtext}`, '_self');
|
||||
open(`${providerURL}${subtext}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user