Skip to content

Commit

Permalink
fix(operation) deal with query strings in operation urls WD-3656
Browse files Browse the repository at this point in the history
  • Loading branch information
edlerd committed May 15, 2023
1 parent ea6ccb4 commit 6c81968
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/api/operations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export const watchOperation = (
timeout = TIMEOUT_10
): Promise<LxdOperation> => {
return new Promise((resolve, reject) => {
fetch(`${operationUrl}/wait?timeout=${timeout}`)
const operationParts = operationUrl.split("?");
const baseUrl = operationParts[0];
const queryString = operationParts.length === 1 ? "" : operationParts[1];
fetch(`${baseUrl}/wait?timeout=${timeout}&${queryString}`)
.then(handleResponse)
.then((data: LxdOperation) => {
if (data.metadata.status === "Success") {
Expand Down

0 comments on commit 6c81968

Please sign in to comment.