todo: fix filter encoding
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-todo': patch
|
||||
---
|
||||
|
||||
Fixed URL encoding of filters where the filter was always rejected by the backend validation.
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user