MCPcopy Create free account
hub / github.com/BrasilAPI/BrasilAPI / getAllCurrencies

Function getAllCurrencies

pages/api/cambio/v1/moedas/index.js:6–21  ·  view source on GitHub ↗
(request, response)

Source from the content-addressed store, hash-verified

4import { getCurrency } from '@/services/cambio/moedas';
5
6async 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
23export default app().get(getAllCurrencies);

Callers

nothing calls this directly

Calls 1

getCurrencyFunction · 0.90

Tested by

no test coverage detected