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

Function action

pages/api/pix/v1/participants.js:32–51  ·  view source on GitHub ↗
(request, response)

Source from the content-addressed store, hash-verified

30};
31
32const action = async (request, response) => {
33 try {
34 const pixParticipantsList = await obtainPixParticipantList();
35
36 const parsedData = formatCsvFile(pixParticipantsList);
37
38 return response.status(200).json(parsedData);
39 } catch (error) {
40 if (error instanceof BaseError) {
41 throw error;
42 }
43
44 throw new InternalError({
45 status: 500,
46 message: `Erro ao obter as informações do BCB`,
47 name: 'PIX_LIST_ERROR',
48 type: 'PIX_LIST_ERROR',
49 });
50 }
51};
52
53/**
54 * Cache de 21600s (6 horas) devido a não saber que horas os dados são gerados pelo BCB.

Callers

nothing calls this directly

Calls 2

formatCsvFileFunction · 0.90
obtainPixParticipantListFunction · 0.85

Tested by

no test coverage detected