diff --git a/src/lib/api.ts b/src/lib/api.ts index 5fe4075..053a480 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -87,7 +87,7 @@ export async function deleteTemplate(id: string): Promise { } // Media -export async function uploadMedia(file: File, projectId?: string): Promise<{ object_name: string; file_url: string; size: number; message: string }> { +export async function uploadMedia(file: File, projectId?: string): Promise<{ url: string; id: string }> { const formData = new FormData(); formData.append('file', file); if (projectId) { @@ -98,7 +98,8 @@ export async function uploadMedia(file: File, projectId?: string): Promise<{ obj 'Content-Type': 'multipart/form-data', }, }); - return response.data; + const { file_url, object_name } = response.data; + return { url: file_url, id: object_name }; } // AI Prediction