Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d5a9ed5

Browse files
committedFeb 19, 2024·
Test
1 parent b264e70 commit d5a9ed5

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed
 

‎mocks/mocks/data/formio-api/custom-components.json

-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@
204204
"tableView": false,
205205
"modalEdit": false,
206206
"data": {
207-
"resource": "",
208207
"url": "http://127.0.0.1:3001/fyllut/api/common-codes/currencies?lang=nb"
209208
},
210209
"valueProperty": "",

‎packages/fyllut-backend/src/routers/api/common-codes.ts

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const commonCodes = {
2727
},
2828

2929
getCurrencies: async (req: Request, res: Response, next: NextFunction) => {
30+
console.log('inside getCurrencies');
3031
// As of 15.07.2022. Different languageCode like nn or en just results in same term,
3132
// so no need to support req.query.languageCode
3233
const languageCode = 'nb';
@@ -35,6 +36,8 @@ const commonCodes = {
3536

3637
try {
3738
const response = await fetchCommonCodeDescriptions(req, 'ValutaBetaling', languageCode);
39+
console.log('currency response', response);
40+
3841
for (const [key, values] of Object.entries(response.betydninger)) {
3942
const currencyName = (values as any)[0]?.beskrivelser?.[languageCode]?.term;
4043
const newObj = { label: `${currencyName} (${key})`, value: key };
@@ -52,6 +55,8 @@ const commonCodes = {
5255
const options = mostUsedCurr.concat(currencyList);
5356
res.send(options);
5457
} catch (e) {
58+
console.log('could not get currencies', e);
59+
5560
next(e);
5661
}
5762
},

‎packages/fyllut/cypress/support/commands.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Cypress.Commands.add('defaultIntercepts', () => {
8585
cy.intercept('GET', '/fyllut/api/config*').as('getConfig');
8686
cy.intercept('GET', '/fyllut/api/countries*').as('getCountries');
8787
cy.intercept('GET', '/fyllut/api/global-translations/*').as('getGlobalTranslations');
88-
cy.intercept('GET', '/fyllut/api/common-codes/currencies*').as('getCurrencies');
88+
cy.intercept('GET', /fyllut\/api\/common-codes\/currencies.*/).as('getCurrencies');
8989
cy.intercept('GET', '/fyllut/api/translations/*').as('getTranslations');
9090
cy.intercept('GET', '/fyllut/api/forms/*').as('getForm');
9191
return cy;

0 commit comments

Comments
 (0)
Please sign in to comment.