From faaac0abec9850ef4c24380aebc16d3fcefb6106 Mon Sep 17 00:00:00 2001 From: ThisBirchWood Date: Tue, 10 Jun 2025 10:59:51 +0200 Subject: [PATCH] PATCH frontend to match new API --- frontend/src/utils/endpoints.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/utils/endpoints.ts b/frontend/src/utils/endpoints.ts index 5e10643..0ec3c92 100644 --- a/frontend/src/utils/endpoints.ts +++ b/frontend/src/utils/endpoints.ts @@ -18,7 +18,8 @@ const uploadFile = async (file: File): Promise => { return ''; } - return await response.text(); + const result = await response.json(); + return result.data?.uuid ?? ''; } catch (error: unknown) { console.error('Error uploading file:', error); return ''; @@ -81,7 +82,7 @@ const getProgress = async (uuid: string): Promise => { } const result = await response.json(); - return parseFloat(result); + return result.data?.progress ?? 0; } catch (error: unknown) { console.error('Error getting progress:', error); return 0; @@ -99,7 +100,8 @@ const getMetadata = async (uuid: string): Promise => { throw new Error(`Failed to fetch metadata: ${response.status}`); } - return await response.json(); + const result = await response.json(); + return result.data; } catch (error: unknown) { console.error('Error fetching metadata:', error);