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