From c91b4beac51e2d5e6342faae1cf51beb536821ed Mon Sep 17 00:00:00 2001 From: miloschwartz Date: Sun, 21 Dec 2025 19:41:53 -0500 Subject: [PATCH] fix resource queries --- .../proxy/[niceId]/authentication/page.tsx | 29 +++++++++-------- src/components/EditInternalResourceDialog.tsx | 12 +++---- src/lib/queries.ts | 31 ++++++++++++++++--- 3 files changed, 48 insertions(+), 24 deletions(-) diff --git a/src/app/[orgId]/settings/resources/proxy/[niceId]/authentication/page.tsx b/src/app/[orgId]/settings/resources/proxy/[niceId]/authentication/page.tsx index fa0784c4..4c520733 100644 --- a/src/app/[orgId]/settings/resources/proxy/[niceId]/authentication/page.tsx +++ b/src/app/[orgId]/settings/resources/proxy/[niceId]/authentication/page.tsx @@ -307,17 +307,18 @@ export default function ResourceAuthenticationPage() { title: t("resourceAuthSettingsSave"), description: t("resourceAuthSettingsSaveDescription") }); - await queryClient.invalidateQueries({ - predicate(query) { - const resourceKey = resourceQueries.resourceClients({ - resourceId: resource.resourceId - }).queryKey; - return ( - query.queryKey[0] === resourceKey[0] && - query.queryKey[1] === resourceKey[1] - ); - } - }); + // invalidate resource queries + await queryClient.invalidateQueries( + resourceQueries.resourceUsers({ + resourceId: resource.resourceId + }) + ); + await queryClient.invalidateQueries( + resourceQueries.resourceRoles({ + resourceId: resource.resourceId + }) + ); + router.refresh(); } catch (e) { console.error(e); @@ -398,7 +399,7 @@ export default function ResourceAuthenticationPage() { api.post(`/resource/${resource.resourceId}/header-auth`, { user: null, password: null, - extendedCompatibility: null, + extendedCompatibility: null }) .then(() => { toast({ @@ -655,7 +656,9 @@ export default function ResourceAuthenticationPage() { {autoLoginEnabled && (