({
workspaceId,
tableId,
limit,
offset,
after,
filter,
sort,
includeTotal,
signal,
}: TableRowsParams & { signal?: AbortSignal })
| 146 | } |
| 147 | |
| 148 | async function fetchTableRows({ |
| 149 | workspaceId, |
| 150 | tableId, |
| 151 | limit, |
| 152 | offset, |
| 153 | after, |
| 154 | filter, |
| 155 | sort, |
| 156 | includeTotal, |
| 157 | signal, |
| 158 | }: TableRowsParams & { signal?: AbortSignal }): Promise<TableRowsResponse> { |
| 159 | const response = await requestJson(listTableRowsContract, { |
| 160 | params: { tableId }, |
| 161 | query: { |
| 162 | workspaceId, |
| 163 | limit, |
| 164 | offset, |
| 165 | after, |
| 166 | filter: filter ?? undefined, |
| 167 | sort: sort ?? undefined, |
| 168 | includeTotal, |
| 169 | }, |
| 170 | signal, |
| 171 | }) |
| 172 | const { rows, totalCount } = response.data |
| 173 | return { rows, totalCount } |
| 174 | } |
| 175 | |
| 176 | function invalidateRowCount(queryClient: ReturnType<typeof useQueryClient>, tableId: string) { |
| 177 | queryClient.invalidateQueries({ queryKey: tableKeys.rowsRoot(tableId) }) |
no test coverage detected