From f34c733706f8773e90fa1828e6c5c498a1acdeb1 Mon Sep 17 00:00:00 2001 From: Alex Blank Date: Mon, 1 Jun 2026 20:20:23 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20remove=20trailing=20slashes=20causing=20?= =?UTF-8?q?FastAPI=20redirect=20=E2=86=92=20mixed-content?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- apps/web/src/api/workspaces.ts | 4 ++-- apps/web/src/hooks/use-workspace-actions.ts | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/web/src/api/workspaces.ts b/apps/web/src/api/workspaces.ts index c032f54..0b845a5 100644 --- a/apps/web/src/api/workspaces.ts +++ b/apps/web/src/api/workspaces.ts @@ -9,7 +9,7 @@ import type { function workspaceUrl(projectId: string, repoId: string, workspaceId?: string) { const base = `/projects/${projectId}/repositories/${repoId}/workspaces`; - return workspaceId ? `${base}/${workspaceId}/` : `${base}/`; + return workspaceId ? `${base}/${workspaceId}` : `${base}/`; } export async function listWorkspaces( @@ -75,7 +75,7 @@ export async function deleteWorkspace( force = false, ): Promise<{ status: string }> { const response = await apiClient.delete<{ status: string }>( - `/workspaces/${workspaceId}/?force=${force}`, + `/workspaces/${workspaceId}?force=${force}`, ); return response.data; } diff --git a/apps/web/src/hooks/use-workspace-actions.ts b/apps/web/src/hooks/use-workspace-actions.ts index 968c163..d4edddc 100644 --- a/apps/web/src/hooks/use-workspace-actions.ts +++ b/apps/web/src/hooks/use-workspace-actions.ts @@ -58,10 +58,7 @@ export function useWorkspaceActions(): UseWorkspaceActionsResult { ); const deleteAction = useCallback( - async ( - workspace: Workspace, - onRefresh: () => Promise, - ) => { + async (workspace: Workspace, onRefresh: () => Promise) => { setLoadingId(workspace.id); try { await deleteWorkspace(workspace.id);