Merge pull request #309 from getmaxun/robot-sort

chore: cleanup src/api
This commit is contained in:
Karishma Shukla
2025-01-01 23:32:37 +05:30
committed by GitHub
3 changed files with 15 additions and 35 deletions

View File

@@ -5,11 +5,6 @@ import { ScheduleSettings } from "../components/molecules/ScheduleSettings";
import { CreateRunResponse, ScheduleRunResponse } from "../pages/MainPage"; import { CreateRunResponse, ScheduleRunResponse } from "../pages/MainPage";
import { apiUrl } from "../apiConfig"; import { apiUrl } from "../apiConfig";
export const getStoredRecordings = async (): Promise<string[] | null> => { export const getStoredRecordings = async (): Promise<string[] | null> => {
try { try {
const response = await axios.get(`${apiUrl}/storage/recordings`); 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> => { 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`);
@@ -99,9 +90,7 @@ 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) {
@@ -121,10 +110,6 @@ export const deleteRecordingFromStorage = async (id: string): Promise<boolean> =
return false; return false;
} }
}; };
export const deleteRunFromStorage = async (id: string): Promise<boolean> => { export const deleteRunFromStorage = async (id: string): Promise<boolean> => {

View File

@@ -33,10 +33,6 @@ interface Column {
format?: (value: string) => string; format?: (value: string) => string;
} }
interface Data { interface Data {
id: string; id: string;
name: string; name: string;
@@ -441,7 +437,6 @@ const OptionsButton = ({ handleEdit, handleDelete, handleDuplicate }: OptionsBut
</ListItemIcon> </ListItemIcon>
<ListItemText>{t('recordingtable.duplicate')}</ListItemText> <ListItemText>{t('recordingtable.duplicate')}</ListItemText>
</MenuItem> </MenuItem>
</Menu> </Menu>
</> </>
); );