Merge pull request #309 from getmaxun/robot-sort
chore: cleanup src/api
This commit is contained in:
@@ -5,11 +5,6 @@ import { ScheduleSettings } from "../components/molecules/ScheduleSettings";
|
||||
import { CreateRunResponse, ScheduleRunResponse } from "../pages/MainPage";
|
||||
import { apiUrl } from "../apiConfig";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getStoredRecordings = async (): Promise<string[] | null> => {
|
||||
try {
|
||||
const response = await axios.get(`${apiUrl}/storage/recordings`);
|
||||
@@ -82,11 +77,7 @@ export const getStoredRecording = async (id: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const checkRunsForRecording = async (id: string): Promise<boolean> => {
|
||||
|
||||
|
||||
try {
|
||||
const response = await axios.get(`${apiUrl}/storage/recordings/${id}/runs`);
|
||||
|
||||
@@ -99,9 +90,7 @@ export const checkRunsForRecording = async (id: string): Promise<boolean> => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export const deleteRecordingFromStorage = async (id: string): Promise<boolean> => {
|
||||
|
||||
const hasRuns = await checkRunsForRecording(id);
|
||||
|
||||
if (hasRuns) {
|
||||
@@ -121,10 +110,6 @@ export const deleteRecordingFromStorage = async (id: string): Promise<boolean> =
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
export const deleteRunFromStorage = async (id: string): Promise<boolean> => {
|
||||
|
||||
@@ -33,10 +33,6 @@ interface Column {
|
||||
format?: (value: string) => string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
interface Data {
|
||||
id: string;
|
||||
name: string;
|
||||
@@ -441,7 +437,6 @@ const OptionsButton = ({ handleEdit, handleDelete, handleDuplicate }: OptionsBut
|
||||
</ListItemIcon>
|
||||
<ListItemText>{t('recordingtable.duplicate')}</ListItemText>
|
||||
</MenuItem>
|
||||
|
||||
</Menu>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user