From 8b82414345db826a104dc9a05e4deb70903b7ecd Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sun, 9 Jun 2024 01:07:37 +0530 Subject: [PATCH] feat: get current tabs --- src/api/recording.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/api/recording.ts b/src/api/recording.ts index 186ef74b..9105de6f 100644 --- a/src/api/recording.ts +++ b/src/api/recording.ts @@ -78,4 +78,16 @@ export const getCurrentUrl = async (): Promise => { } }; - +export const getCurrentTabs = async (): Promise => { + try { + const response = await axios.get('http://localhost:8080/record/active/tabs'); + if (response.status === 200) { + return response.data; + } else { + throw new Error('Couldn\'t retrieve stored recordings'); + } + } catch(error: any) { + console.log(error); + return null; + } +};