From 06c22f1d239f77e51e72077915d15e3a525138f0 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Thu, 17 Oct 2024 14:36:04 +0530 Subject: [PATCH] feat: get stored recording --- src/api/storage.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/api/storage.ts b/src/api/storage.ts index 2ff1e82a..b4d09ec8 100644 --- a/src/api/storage.ts +++ b/src/api/storage.ts @@ -32,6 +32,20 @@ export const getStoredRuns = async (): Promise => { } }; +export const getStoredRecording = async (id: string): Promise => { + try { + const response = await axios.get(`http://localhost:8080/storage/recordings/${id}`); + if (response.status === 200) { + return response.data; + } else { + throw new Error(`Couldn't retrieve stored recording ${id}`); + } + } catch(error: any) { + console.log(error); + return null; + } +} + export const deleteRecordingFromStorage = async (id: string): Promise => { try { const response = await axios.delete(`http://localhost:8080/storage/recordings/${id}`);