Spaces:
Running
Running
axeronis commited on
Commit ·
17ddac1
1
Parent(s): 1bd37d2
fix: invalidate all ai-settings queries using predicate to match Settings page cache
Browse files
frontend/app/demo-chat/page.tsx
CHANGED
|
@@ -143,8 +143,14 @@ export default function DemoChatPage() {
|
|
| 143 |
|
| 144 |
if (response.data.success) {
|
| 145 |
toast.success(`✅ ${response.data.message}`)
|
| 146 |
-
|
| 147 |
-
queryClient.invalidateQueries({
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
|
| 149 |
setMessages(prev => [...prev, {
|
| 150 |
id: crypto.randomUUID(),
|
|
|
|
| 143 |
|
| 144 |
if (response.data.success) {
|
| 145 |
toast.success(`✅ ${response.data.message}`)
|
| 146 |
+
// Invalidate ALL queries that start with these keys (including ['ai-settings', tenant_id])
|
| 147 |
+
queryClient.invalidateQueries({
|
| 148 |
+
predicate: (query) => {
|
| 149 |
+
const key = query.queryKey[0]
|
| 150 |
+
return key === 'tenant' || key === 'ai-settings'
|
| 151 |
+
}
|
| 152 |
+
})
|
| 153 |
+
|
| 154 |
|
| 155 |
setMessages(prev => [...prev, {
|
| 156 |
id: crypto.randomUUID(),
|