From 7a0417a0b76cfc7beb7c24be243d9aa62495cf51 Mon Sep 17 00:00:00 2001 From: Adam Cohen Hillel Date: Sun, 20 Apr 2025 18:43:24 +0100 Subject: [PATCH] fixy --- frontend/src/lib/api.ts | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index 30387dd6..e8611d82 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -189,29 +189,6 @@ export const getProject = async (projectId: string): Promise => { } else { console.log('Sandbox activation successful'); } - - console.log('Raw project data from database:', data); - - // If project has a sandbox, ensure it's started - if (data.sandbox?.id) { - try { - const { data: { session } } = await supabase.auth.getSession(); - if (session?.access_token) { - console.log(`Ensuring sandbox is active for project ${projectId}...`); - const response = await fetch(`${API_URL}/project/${projectId}/sandbox/ensure-active`, { - method: 'POST', - headers: { - 'Authorization': `Bearer ${session.access_token}`, - 'Content-Type': 'application/json', - }, - }); - - if (!response.ok) { - const errorText = await response.text().catch(() => 'No error details available'); - console.warn(`Failed to ensure sandbox is active: ${response.status} ${response.statusText}`, errorText); - } else { - console.log('Sandbox activation successful'); - } } catch (sandboxError) { console.warn('Failed to ensure sandbox is active:', sandboxError); @@ -238,22 +215,6 @@ export const getProject = async (projectId: string): Promise => { console.error(`Error fetching project ${projectId}:`, error); throw error; } - - // Map database fields to our Project type - const mappedProject: Project = { - id: data.project_id, - name: data.name || '', - description: data.description || '', - account_id: data.account_id, - created_at: data.created_at, - sandbox: data.sandbox || { id: "", pass: "", vnc_preview: "", sandbox_url: "" } - }; - - console.log('Mapped project data for frontend:', mappedProject); - - // Cache the result - apiCache.setProject(projectId, mappedProject); - return mappedProject; }; export const createProject = async (