From caa39a062e0109e195be712cc7612dee6520b78d Mon Sep 17 00:00:00 2001 From: Rohit Date: Tue, 3 Jun 2025 19:27:56 +0530 Subject: [PATCH] feat: add can create browser api --- src/api/recording.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/api/recording.ts b/src/api/recording.ts index 6b816001..ce07753a 100644 --- a/src/api/recording.ts +++ b/src/api/recording.ts @@ -35,6 +35,19 @@ export const getActiveBrowserId = async(): Promise => { } }; +export const canCreateBrowserInState = async(state: "recording" | "run"): Promise => { + try { + const response = await axios.get(`${apiUrl}/record/can-create/${state}`, { withCredentials: true }); + if (response.status === 200) { + return response.data.canCreate; + } else { + return false; + } + } catch(error: any) { + return false; + } +}; + export const interpretCurrentRecording = async(): Promise => { try { const response = await axios.get(`${apiUrl}/record/interpret`);