feat: use id instead of runId

This commit is contained in:
karishmas6
2024-10-10 02:24:23 +05:30
parent 590e7e9d9f
commit 64e313de01

View File

@@ -90,13 +90,13 @@ export const createRunForStoredRecording = async (id: string, settings: RunSetti
} }
} }
export const interpretStoredRecording = async (runId: string): Promise<boolean> => { export const interpretStoredRecording = async (id: string): Promise<boolean> => {
try { try {
const response = await axios.post(`http://localhost:8080/storage/runs/run/${runId}`); const response = await axios.post(`http://localhost:8080/storage/runs/run/${id}`);
if (response.status === 200) { if (response.status === 200) {
return response.data; return response.data;
} else { } else {
throw new Error(`Couldn't run a recording ${runId}`); throw new Error(`Couldn't run a recording ${id}`);
} }
} catch(error: any) { } catch(error: any) {
console.log(error); console.log(error);
@@ -104,13 +104,13 @@ export const interpretStoredRecording = async (runId: string): Promise<boolean>
} }
} }
export const notifyAboutAbort = async (runId:string): Promise<boolean> => { export const notifyAboutAbort = async (id:string): Promise<boolean> => {
try { try {
const response = await axios.post(`http://localhost:8080/storage/runs/abort/${runId}`); const response = await axios.post(`http://localhost:8080/storage/runs/abort/${id}`);
if (response.status === 200) { if (response.status === 200) {
return response.data; return response.data;
} else { } else {
throw new Error(`Couldn't abort a running recording with id ${runId}`); throw new Error(`Couldn't abort a running recording with id ${id}`);
} }
} catch(error: any) { } catch(error: any) {
console.log(error); console.log(error);