Skip to content

Commit

Permalink
Exclude empty params in decosUrlParams in getZakenByUserKey
Browse files Browse the repository at this point in the history
  • Loading branch information
TvanWalen committed Dec 19, 2024
1 parent 11695b4 commit 187f710
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/server/services/decos/decos-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,11 @@ async function getZakenByUserKey(
.map((transformer) => `${caseField} eq ${transformer.caseType}`)
.join(' or ');

const decosUrlParams = [
'top=50',
fields ? `select=${fields}` : '',
caseTypes ? `filter=${caseTypes}` : '',
].join('&');
const decosUrlParams = new URLSearchParams({
top: '50',
...(fields && { select: fields }),
...(caseTypes && { filter: caseTypes }),
});

const apiConfig = getApiConfig('DECOS_API', {
formatUrl: (config) => {
Expand Down

0 comments on commit 187f710

Please sign in to comment.