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; endpoint: string;
body: object | undefined | null; body: object | undefined | null;
}) => callEndpoint(method, endpoint, body), }) => callEndpoint(method, endpoint, body),
onMutate: () => { onMutate: ({ method, endpoint }) => {
queryClient.invalidateQueries(); queryClient.resetQueries({
queryKey: ['GET', endpoint],
force: true,
});
}, },
onSuccess: () => { onSuccess: (data, { method, endpoint }) => {
queryClient.invalidateQueries(); queryClient.resetQueries({
queryKey: ['GET', endpoint],
force: true,
});
}, },
}); });
} }

View File

@@ -101,7 +101,7 @@ export default function Search({
endpoint: 'api/searchHistory', endpoint: 'api/searchHistory',
body: { prefix: providerPrefix, provider: providerLabel, searchTerm: subtext }, body: { prefix: providerPrefix, provider: providerLabel, searchTerm: subtext },
}).then(() => { }).then(() => {
open(`${providerURL}${subtext}`, '_self'); open(`${providerURL}${subtext}`);
}); });
} }
} }