2026-01-28 05:48:46 +00:00
|
|
|
import { apiHelpers } from "./api-local";
|
|
|
|
|
|
|
|
|
|
const uploadApi = {
|
|
|
|
|
uploadFile: async (file: File, page: any | null, sheet: string | null, fileDesc: string): Promise<any> => {
|
|
|
|
|
const formData = new FormData();
|
|
|
|
|
formData.append("file", file);
|
|
|
|
|
if (page) formData.append("page", page);
|
|
|
|
|
if (sheet) formData.append("sheet", sheet);
|
|
|
|
|
formData.append("file_desc", fileDesc);
|
|
|
|
|
|
2026-02-10 01:56:22 +00:00
|
|
|
// return apiHelpers.post("/upload/file", formData, {
|
|
|
|
|
return apiHelpers.post("/pipeline/analyze", formData, {
|
2026-01-28 05:48:46 +00:00
|
|
|
headers: { "Content-Type": "multipart/form-data" },
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
processPdf: async (data: any, fileName: string, fileDesc: string): Promise<any> => {
|
|
|
|
|
const payload = { ...data, fileName, fileDesc };
|
2026-02-10 01:56:22 +00:00
|
|
|
// return apiHelpers.post("/upload/process-pdf", payload);
|
|
|
|
|
return apiHelpers.post("/pipeline/analyze/df", payload);
|
2026-01-28 05:48:46 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
saveToDatabase: async (data: any): Promise<any> => {
|
2026-02-10 01:56:22 +00:00
|
|
|
// return apiHelpers.post("/upload/to-postgis", data);
|
|
|
|
|
return apiHelpers.post("/pipeline/publish", data);
|
2026-01-28 05:48:46 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getStyles: async (): Promise<any> => {
|
|
|
|
|
return apiHelpers.get("/dataset/styles");
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default uploadApi;
|