(request, response)
| 4 | import { getCurrency } from '@/services/cambio/moedas'; |
| 5 | |
| 6 | async function getAllCurrencies(request, response) { |
| 7 | try { |
| 8 | const currency = await getCurrency(); |
| 9 | |
| 10 | return response.status(200).json(Array.from(currency.values())); |
| 11 | } catch (error) { |
| 12 | if (error instanceof BaseError) { |
| 13 | throw error; |
| 14 | } |
| 15 | |
| 16 | throw new InternalError({ |
| 17 | message: 'Erro ao buscar moedas.', |
| 18 | type: 'moedas_error', |
| 19 | }); |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | export default app().get(getAllCurrencies); |
nothing calls this directly
no test coverage detected