github
2100 of 3368 branches covered (62.35%)
3 of 166 new or added lines in 12 files covered. (1.81%)
1 existing line in 1 file now uncovered.25577 of 98196 relevant lines covered (26.05%)
5.17 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
|
}; |
× |