feat: get current url

This commit is contained in:
karishmas6
2024-06-09 01:07:30 +05:30
parent 812f2b1005
commit 823a708c27

View File

@@ -64,3 +64,18 @@ export const stopCurrentInterpretation = async(): Promise<void> => {
}
};
export const getCurrentUrl = async (): Promise<string | null> => {
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;
}
};