(workspaceIds: string[])
| 75 | export const chatsByWorkspaceKeyPrefix = [...chatsKey, "by-workspace"] as const; |
| 76 | |
| 77 | export const chatsByWorkspace = (workspaceIds: string[]) => { |
| 78 | const sorted = workspaceIds.toSorted(); |
| 79 | return { |
| 80 | queryKey: [...chatsKey, "by-workspace", sorted], |
| 81 | queryFn: () => API.experimental.getChatsByWorkspace(sorted), |
| 82 | enabled: workspaceIds.length > 0, |
| 83 | }; |
| 84 | }; |
| 85 | |
| 86 | /** |
| 87 | * Updates a single chat inside every page of the infinite chats query |