| 35 | import { POST } from '@/app/api/table/[tableId]/export-async/route' |
| 36 | |
| 37 | function buildTable(overrides: Partial<TableDefinition> = {}): TableDefinition { |
| 38 | return { |
| 39 | id: 'tbl_1', |
| 40 | name: 'People', |
| 41 | description: null, |
| 42 | schema: { columns: [{ name: 'name', type: 'string' }] }, |
| 43 | metadata: null, |
| 44 | rowCount: 50000, |
| 45 | maxRows: 1_000_000, |
| 46 | workspaceId: 'workspace-1', |
| 47 | createdBy: 'user-1', |
| 48 | archivedAt: null, |
| 49 | createdAt: new Date(), |
| 50 | updatedAt: new Date(), |
| 51 | ...overrides, |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | function makeRequest(body: unknown, tableId = 'tbl_1') { |
| 56 | const req = new NextRequest(`http://localhost:3000/api/table/${tableId}/export-async`, { |