todo: fix filter encoding

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-08-10 16:40:26 +02:00
parent 999376ee01
commit ad3fb54017
2 changed files with 16 additions and 7 deletions
+11 -7
View File
@@ -67,13 +67,17 @@ export class TodoClient implements TodoApi {
}
}
const res = await fetch(`${baseUrl}/v1/todos?${query}`, {
headers: token
? {
Authorization: `Bearer ${token}`,
}
: undefined,
});
const res = await fetch(
// TODO(Rugvip): Figure out a better solution to '*' not being URL encoded but that being required by OpenAPI
`${baseUrl}/v1/todos?${String(query).replace(/\*/g, '%2A')}`,
{
headers: token
? {
Authorization: `Bearer ${token}`,
}
: undefined,
},
);
if (!res.ok) {
throw await ResponseError.fromResponse(res);