diff --git a/src/server/services/decos/decos-service.ts b/src/server/services/decos/decos-service.ts index baf784d47..e27d6cc64 100644 --- a/src/server/services/decos/decos-service.ts +++ b/src/server/services/decos/decos-service.ts @@ -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) => {