fix: remove trailing slashes causing FastAPI redirect → mixed-content
- workspaceUrl: no trailing slash on /{workspaceId} (backend route has none)
- deleteWorkspace: /workspaces/{id}?force= (was /{id}/?force= with slash before ?)
Quality gates: tsc --noEmit clean, pytest workspaces API (9 passed, 1 skipped)
This commit is contained in:
@@ -9,7 +9,7 @@ import type {
|
|||||||
|
|
||||||
function workspaceUrl(projectId: string, repoId: string, workspaceId?: string) {
|
function workspaceUrl(projectId: string, repoId: string, workspaceId?: string) {
|
||||||
const base = `/projects/${projectId}/repositories/${repoId}/workspaces`;
|
const base = `/projects/${projectId}/repositories/${repoId}/workspaces`;
|
||||||
return workspaceId ? `${base}/${workspaceId}/` : `${base}/`;
|
return workspaceId ? `${base}/${workspaceId}` : `${base}/`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function listWorkspaces(
|
export async function listWorkspaces(
|
||||||
@@ -75,7 +75,7 @@ export async function deleteWorkspace(
|
|||||||
force = false,
|
force = false,
|
||||||
): Promise<{ status: string }> {
|
): Promise<{ status: string }> {
|
||||||
const response = await apiClient.delete<{ status: string }>(
|
const response = await apiClient.delete<{ status: string }>(
|
||||||
`/workspaces/${workspaceId}/?force=${force}`,
|
`/workspaces/${workspaceId}?force=${force}`,
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,10 +58,7 @@ export function useWorkspaceActions(): UseWorkspaceActionsResult {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const deleteAction = useCallback(
|
const deleteAction = useCallback(
|
||||||
async (
|
async (workspace: Workspace, onRefresh: () => Promise<void>) => {
|
||||||
workspace: Workspace,
|
|
||||||
onRefresh: () => Promise<void>,
|
|
||||||
) => {
|
|
||||||
setLoadingId(workspace.id);
|
setLoadingId(workspace.id);
|
||||||
try {
|
try {
|
||||||
await deleteWorkspace(workspace.id);
|
await deleteWorkspace(workspace.id);
|
||||||
|
|||||||
Reference in New Issue
Block a user