(bank-sync) expose demo bank in the get-banks endpoint (#168)

Exposing the demo bank again in the get-banks endpoint.

Frontend implementation of the `showDemo` will come next. The demo bank
will only be available for DEV and PREVIEW builds.
This commit is contained in:
Matiss Janis Aboltins
2023-03-19 19:55:51 +00:00
committed by GitHub
parent df70a791fd
commit 19dbf815e6
2 changed files with 16 additions and 2 deletions

View File

@@ -88,14 +88,22 @@ app.post(
app.post(
'/get-banks',
handleError(async (req, res) => {
let { country } = req.body;
let { country, showDemo = false } = req.body;
await nordigenService.setToken();
const data = await nordigenService.getInstitutions(country);
res.send({
status: 'ok',
data,
data: showDemo
? [
{
id: 'SANDBOXFINANCE_SFIN0000',
name: 'DEMO bank (used for testing bank-sync)',
},
...data,
]
: data,
});
}),
);

View File

@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [MatissJanis]
---
Expose demo bank that can be used to test Nordigen bank-sync