Skip to content

Commit

Permalink
Fix Traceflow deletion in web client (antrea-io#362)
Browse files Browse the repository at this point in the history
After a Traceflow request initiated in the UI completes, we delete the
Traceflow resource. This was broken because the wrong base URL was used.

Signed-off-by: Antonin Bas <[email protected]>
  • Loading branch information
antoninbas committed May 10, 2024
1 parent 64b102f commit 8dbf3ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/web/antrea-ui/src/api/traceflow.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ describe('Traceflow API', () => {
baseURL: '',
}));
if (withDelete) {
expect(mock.delete).toHaveBeenCalledWith(`/api/v1/traceflow/${reqId}`, expect.anything());
expect(mock.delete).toHaveBeenCalledWith(`/api/v1/traceflow/${reqId}`, expect.objectContaining({
baseURL: '',
}));
} else {
expect(mock.delete).not.toHaveBeenCalled();
}
Expand Down
1 change: 1 addition & 0 deletions client/web/antrea-ui/src/api/traceflow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export const traceflowAPI = {
if (done) {
if (withDelete) {
await api.delete(reqURL, {
baseURL: `${apiServer}`,
validateStatus: (status: number) => status === 200,
}).then(_ => console.log("Traceflow deleted successfully")).catch(_ => console.error("Unable to delete traceflow"));
}
Expand Down

0 comments on commit 8dbf3ab

Please sign in to comment.