Hotfix for search refresh

This commit is contained in:
Sean Edmunds
2025-02-20 16:55:07 -06:00
parent b017e02747
commit b59ef285bd
2 changed files with 11 additions and 5 deletions

View File

@@ -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,
});
},
});
}

View File

@@ -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}`);
});
}
}