(workspaceId: string | undefined, tableId: string | undefined)
| 242 | * Fetch a single table by id. |
| 243 | */ |
| 244 | export function useTable(workspaceId: string | undefined, tableId: string | undefined) { |
| 245 | // rq-lint-allow: tableId is a globally-unique id; workspaceId is only an authz scope on the fetch and cannot collide across workspaces |
| 246 | return useQuery({ |
| 247 | queryKey: tableKeys.detail(tableId ?? ''), |
| 248 | queryFn: ({ signal }) => fetchTable(workspaceId as string, tableId as string, signal), |
| 249 | enabled: Boolean(workspaceId && tableId), |
| 250 | staleTime: 30 * 1000, |
| 251 | }) |
| 252 | } |
| 253 | |
| 254 | /** |
| 255 | * Shared table-detail query options so non-component callers (e.g. selector |
no test coverage detected