Fix workspace form not refreshing when project accessed via URL key
The invalidateProject() in ProjectProperties only invalidated queryKeys.projects.detail(project.id) (UUID), but the parent ProjectDetail query uses routeProjectRef which is typically the URL key (e.g. "openclaw-testing"). This meant mutations succeeded but the parent query was never refetched — the UI only updated on page refresh. Now also invalidates via project.urlKey so both UUID and URL-key based query caches are cleared. Co-Authored-By: Paperclip <noreply@paperclip.ing> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -205,6 +205,9 @@ export function ProjectProperties({ project, onUpdate, onFieldUpdate, getFieldSa
|
||||
|
||||
const invalidateProject = () => {
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.projects.detail(project.id) });
|
||||
if (project.urlKey !== project.id) {
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.projects.detail(project.urlKey) });
|
||||
}
|
||||
if (selectedCompanyId) {
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.projects.list(selectedCompanyId) });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user