|
|
@ -60,8 +60,11 @@ export async function releaseVersion(_req: Request, res: Response) { |
|
|
|
res.json(result); |
|
|
|
res.json(result); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export async function axiosRequestMake(req: Request, res: Response) { |
|
|
|
async function _axiosRequestMake(req: Request, res: Response, type: string) { |
|
|
|
const { apiMeta } = req.body; |
|
|
|
const { apiMeta } = req.body; |
|
|
|
|
|
|
|
if (type === 'csvUrl' || type === 'excelUrl') { |
|
|
|
|
|
|
|
apiMeta.responseType = 'arraybuffer'; |
|
|
|
|
|
|
|
} |
|
|
|
if (apiMeta?.body) { |
|
|
|
if (apiMeta?.body) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
apiMeta.body = JSON.parse(apiMeta.body); |
|
|
|
apiMeta.body = JSON.parse(apiMeta.body); |
|
|
@ -106,6 +109,16 @@ export async function axiosRequestMake(req: Request, res: Response) { |
|
|
|
return res.json(data?.data); |
|
|
|
return res.json(data?.data); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export async function axiosRequestMake(req: Request, res: Response) { |
|
|
|
|
|
|
|
const { |
|
|
|
|
|
|
|
apiMeta: { type } |
|
|
|
|
|
|
|
} = req.body; |
|
|
|
|
|
|
|
if (type === 'csvUrl' || type === 'excelUrl') { |
|
|
|
|
|
|
|
return await _axiosRequestMake(req, res, type); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return res.json({}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export default router => { |
|
|
|
export default router => { |
|
|
|
router.post( |
|
|
|
router.post( |
|
|
|
'/api/v1/db/meta/connection/test', |
|
|
|
'/api/v1/db/meta/connection/test', |
|
|
|