mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-25 13:45:03 +08:00
fix(usage): treat usage_script credentials as explicit overrides (#4654)
* fix(usage): treat usage_script credentials as explicit overrides * fix: treat usage script credentials as explicit overrides
This commit is contained in:
@@ -9,6 +9,7 @@ import { extractErrorMessage } from "@/utils/errorUtils";
|
||||
import { generateUUID } from "@/utils/uuid";
|
||||
import { openclawKeys } from "@/hooks/useOpenClaw";
|
||||
import { invalidateHermesProviderCaches } from "@/hooks/useHermes";
|
||||
import { usageKeys } from "@/lib/query/usage";
|
||||
|
||||
export const useAddProviderMutation = (appId: AppId) => {
|
||||
const queryClient = useQueryClient();
|
||||
@@ -141,8 +142,16 @@ export const useUpdateProviderMutation = (appId: AppId) => {
|
||||
await providersApi.update(provider, appId, originalId);
|
||||
return provider;
|
||||
},
|
||||
onSuccess: async () => {
|
||||
onSuccess: async (provider, variables) => {
|
||||
await queryClient.invalidateQueries({ queryKey: ["providers", appId] });
|
||||
await queryClient.invalidateQueries({
|
||||
queryKey: usageKeys.script(provider.id, appId),
|
||||
});
|
||||
if (variables.originalId && variables.originalId !== provider.id) {
|
||||
await queryClient.invalidateQueries({
|
||||
queryKey: usageKeys.script(variables.originalId, appId),
|
||||
});
|
||||
}
|
||||
if (appId === "openclaw") {
|
||||
await queryClient.invalidateQueries({
|
||||
queryKey: openclawKeys.health,
|
||||
|
||||
Reference in New Issue
Block a user