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

Function action

pages/api/cvm/fundos/v1/index.js:8–24  ·  view source on GitHub ↗
(request, response)

Source from the content-addressed store, hash-verified

6import { getFunds } from '@/services/cvm/fundos';
7
8const 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
26export default app({ cache: 86400 }).get(action);

Callers

nothing calls this directly

Calls 1

getFundsFunction · 0.90

Tested by

no test coverage detected