From 823a708c276e24aa94021e05e4cba567561f04c1 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sun, 9 Jun 2024 01:07:30 +0530 Subject: [PATCH] feat: get current url --- src/api/recording.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/api/recording.ts b/src/api/recording.ts index 6730b6bb..186ef74b 100644 --- a/src/api/recording.ts +++ b/src/api/recording.ts @@ -64,3 +64,18 @@ export const stopCurrentInterpretation = async(): Promise => { } }; +export const getCurrentUrl = async (): Promise => { + try { + const response = await axios.get('http://localhost:8080/record/active/url'); + if (response.status === 200) { + return response.data; + } else { + throw new Error('Couldn\'t retrieve stored recordings'); + } + } catch(error: any) { + console.log(error); + return null; + } +}; + +