(request, response)
| 6 | import { getFunds } from '@/services/cvm/fundos'; |
| 7 | |
| 8 | const action = async (request, response) => { |
| 9 | try { |
| 10 | const { page, size } = request.query; |
| 11 | const fundData = await getFunds(size, page); |
| 12 | return response.status(200).json(fundData); |
| 13 | } catch (err) { |
| 14 | if (err instanceof BaseError) { |
| 15 | throw err; |
| 16 | } |
| 17 | |
| 18 | throw new InternalError({ |
| 19 | message: 'Erro ao buscar informações sobre fundos', |
| 20 | type: 'exchange_error', |
| 21 | name: 'EXCHANGE_INTERNAL', |
| 22 | }); |
| 23 | } |
| 24 | }; |
| 25 | |
| 26 | export default app({ cache: 86400 }).get(action); |
nothing calls this directly
no test coverage detected