| 64 | import { POST } from '@/app/api/table/[tableId]/delete-async/route' |
| 65 | |
| 66 | function buildTable(overrides: Partial<TableDefinition> = {}): TableDefinition { |
| 67 | return { |
| 68 | id: 'tbl_1', |
| 69 | name: 'People', |
| 70 | description: null, |
| 71 | schema: { columns: [{ name: 'status', type: 'string' }] }, |
| 72 | metadata: null, |
| 73 | rowCount: 1000, |
| 74 | maxRows: 1_000_000, |
| 75 | workspaceId: 'workspace-1', |
| 76 | createdBy: 'user-1', |
| 77 | archivedAt: null, |
| 78 | createdAt: new Date(), |
| 79 | updatedAt: new Date(), |
| 80 | ...overrides, |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | function makeRequest(body: unknown, tableId = 'tbl_1') { |
| 85 | const req = new NextRequest(`http://localhost:3000/api/table/${tableId}/delete-async`, { |