github
1396 of 2501 branches covered (55.82%)
9 of 79 new or added lines in 7 files covered. (11.39%)
8 existing lines in 3 files now uncovered.14548 of 66649 relevant lines covered (21.83%)
2.09 hits per line
NEW
|
import type { RouteConfig } from '@asteasolutions/zod-to-openapi'; |
|
NEW
|
import { axios } from '../axios'; |
× |
NEW
|
import { registerRoute, urlBuilder } from '../utils'; |
× |
NEW
|
import { z } from '../zod'; |
× |
NEW
|
|
× |
NEW
|
export const EXPORT_CSV_FROM_TABLE = '/export/{tableId}'; |
× |
NEW
|
|
× |
NEW
|
export const ExportCsvFromTableRoute: RouteConfig = registerRoute({ |
× |
NEW
|
method: 'get', |
× |
NEW
|
path: EXPORT_CSV_FROM_TABLE, |
× |
NEW
|
description: 'export csv from table', |
× |
NEW
|
request: { |
× |
NEW
|
params: z.object({
|
× |
NEW
|
tableId: z.string(), |
× |
NEW
|
}), |
× |
NEW
|
}, |
× |
NEW
|
responses: {
|
× |
NEW
|
200: {
|
× |
NEW
|
description: 'Download successful', |
× |
NEW
|
}, |
× |
NEW
|
}, |
× |
NEW
|
tags: ['export'], |
× |
NEW
|
}); |
× |
NEW
|
|
× |
NEW
|
export const exportCsvFromTable = async (tableId: string) => { |
× |
NEW
|
return axios.get(urlBuilder(EXPORT_CSV_FROM_TABLE, { tableId }));
|
× |
NEW
|
}; |
× |