refactor: modularize road management modules

This commit is contained in:
2026-06-17 13:31:25 +05:30
parent 9bb740e446
commit 182d4ac293
41 changed files with 2386 additions and 1894 deletions

View File

@@ -1,4 +1,5 @@
import axiosClient from '../axios/axios';
import { API_ROUTES } from '@/constants/apiRoutes';
import { Video, PaginationParams } from '@/types';
/**
@@ -27,7 +28,7 @@ export const videoService = {
total_detections?: number;
};
}>;
}>(`/videos`, {
}>(API_ROUTES.VIDEOS.LIST, {
params: { skip, limit },
});
@@ -53,7 +54,7 @@ export const videoService = {
* Upload a video for processing
*/
uploadVideo: async (formData: FormData): Promise<any> => {
const response = await axiosClient.post('/upload', formData, {
const response = await axiosClient.post(API_ROUTES.VIDEOS.UPLOAD, formData, {
headers: {
'Content-Type': 'multipart/form-data',
},
@@ -65,7 +66,7 @@ export const videoService = {
* Get processing status of a video
*/
getVideoStatus: async (videoId: string): Promise<any> => {
const response = await axiosClient.get(`/status/${videoId}`);
const response = await axiosClient.get(API_ROUTES.VIDEOS.STATUS(videoId));
return response.data;
},
@@ -73,7 +74,7 @@ export const videoService = {
* Get analysis results for a video
*/
getVideoResults: async (videoId: string): Promise<any> => {
const response = await axiosClient.get(`/results/${videoId}`);
const response = await axiosClient.get(API_ROUTES.VIDEOS.RESULTS(videoId));
return response.data;
},
};