fix(frontend): fix encoding of queryparameters in api calls

We had a bug where the "+" before the timezone in ISO8601 strings was
being parsed as " " in the server because it was not properly encoded.

By using URLSearchParams to create our querystring we should be fine.
This commit is contained in:
Julian Tölle 2020-06-01 21:17:40 +02:00
parent e2b927fca4
commit 40ce26eadd
2 changed files with 24 additions and 6 deletions

View file

@ -0,0 +1,12 @@
interface QueryParameters {
[x: string]: string;
}
export const qs = (parameters: QueryParameters): string => {
const queryParams = new URLSearchParams();
Object.entries(parameters).forEach(([key, value]) =>
queryParams.append(key, value)
);
return queryParams.toString();
};