fix: format
This commit is contained in:
@@ -77,11 +77,7 @@ export const getStoredRecording = async (id: string) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const checkRunsForRecording = async (id: string): Promise<boolean> => {
|
export const checkRunsForRecording = async (id: string): Promise<boolean> => {
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(`${apiUrl}/storage/recordings/${id}/runs`);
|
const response = await axios.get(`${apiUrl}/storage/recordings/${id}/runs`);
|
||||||
|
|
||||||
@@ -94,32 +90,26 @@ export const checkRunsForRecording = async (id: string): Promise<boolean> => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export const deleteRecordingFromStorage = async (id: string): Promise<boolean> => {
|
export const deleteRecordingFromStorage = async (id: string): Promise<boolean> => {
|
||||||
|
|
||||||
const hasRuns = await checkRunsForRecording(id);
|
const hasRuns = await checkRunsForRecording(id);
|
||||||
|
|
||||||
if (hasRuns) {
|
if (hasRuns) {
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const response = await axios.delete(`${apiUrl}/storage/recordings/${id}`);
|
const response = await axios.delete(`${apiUrl}/storage/recordings/${id}`);
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Couldn't delete stored recording ${id}`);
|
throw new Error(`Couldn't delete stored recording ${id}`);
|
||||||
}
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const deleteRunFromStorage = async (id: string): Promise<boolean> => {
|
export const deleteRunFromStorage = async (id: string): Promise<boolean> => {
|
||||||
@@ -154,7 +144,7 @@ export const createRunForStoredRecording = async (id: string, settings: RunSetti
|
|||||||
try {
|
try {
|
||||||
const response = await axios.put(
|
const response = await axios.put(
|
||||||
`${apiUrl}/storage/runs/${id}`,
|
`${apiUrl}/storage/runs/${id}`,
|
||||||
{ ...settings });
|
{ ...settings });
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
return response.data;
|
return response.data;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user