Skip to content

Commit

Permalink
properly split query parameter for email
Browse files Browse the repository at this point in the history
Service unit query parameter was previously sent as single string like "1,2,3,4", which is not a proper input for forms.ModelMultipleChoiceField.
Synchronous reports already handled this query string properly, so now email reports use the same query parameter parsing for service unit.
  • Loading branch information
juho-kettunen-nc committed Aug 14, 2024
1 parent 40ebb30 commit 7ba3477
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/leaseStatisticReport/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ export const fetchReportData = (payload: Record<string, any>): Generator<any, an
return callApi(new Request(`${payload.url}?${parsedQuery}`));
};
export const sendReportToMail = (payload: Record<string, any>): Generator<any, any, any> => {
return callApi(new Request(`${payload.url}?${payload.query}`));
const parsedQuery = parseServiceUnitQuery(payload.query) || '';
return callApi(new Request(`${payload.url}?${parsedQuery}`));
};
export const fetchOptions = (payload: any): Generator<any, any, any> => {
return callApi(new Request(payload, {
method: 'OPTIONS'
}));
};
};

0 comments on commit 7ba3477

Please sign in to comment.