From c25d762ed144acebf3e1a34f55297df155db1417 Mon Sep 17 00:00:00 2001 From: Binks Riverton Date: Mon, 22 Jun 2026 19:50:09 +0800 Subject: [PATCH] fix(organization): invalidate fetch cache after creating org Reset organizationsLoadedAt to 0 after orgStore.create() succeeds, so that the subsequent fetchOrganizations() call from handleSettingsSaved is not blocked by the 60-second TTL cache. This ensures resource_counts and other aggregated fields are refreshed immediately after creating a shared space. --- frontend/src/stores/organization.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/stores/organization.ts b/frontend/src/stores/organization.ts index 6bcc8d94..3df7e430 100644 --- a/frontend/src/stores/organization.ts +++ b/frontend/src/stores/organization.ts @@ -112,6 +112,9 @@ export const useOrganizationStore = defineStore('organization', () => { const response = await createOrganization({ name, description }) if (response.success && response.data) { organizations.value.unshift(response.data) + // 创建成功后重置缓存时间戳,确保后续 fetchOrganizations() 不会被 TTL 缓存跳过, + // 从而刷新 resource_counts 等创建接口不返回的聚合字段。 + organizationsLoadedAt = 0 return response.data } else { error.value = response.message || 'Failed to create organization'