feat: add can create browser api

This commit is contained in:
Rohit
2025-06-03 19:27:56 +05:30
parent 7a0ae617cf
commit caa39a062e

View File

@@ -35,6 +35,19 @@ export const getActiveBrowserId = async(): Promise<string> => {
}
};
export const canCreateBrowserInState = async(state: "recording" | "run"): Promise<boolean> => {
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<boolean> => {
try {
const response = await axios.get(`${apiUrl}/record/interpret`);