Hotfix for search refresh
This commit is contained in:
@@ -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,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user