|
|
|
|
@ -48,7 +48,7 @@ export const getPoints = async (params, region, dbTable = "placement_points", si
|
|
|
|
|
const resultParams = enrichParamsWithRegionFilter(params, region);
|
|
|
|
|
|
|
|
|
|
const { data } = await api.get(
|
|
|
|
|
`/api/${dbTable}/?${resultParams.toString()}`, { signal }
|
|
|
|
|
`https://postamates.spatialsystems.ru/api/${dbTable}/?${resultParams.toString()}`, { signal }
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
@ -58,7 +58,7 @@ export const exportPoints = async (params, region, dbTable = "placement_points")
|
|
|
|
|
const resultParams = enrichParamsWithRegionFilter(params, region);
|
|
|
|
|
|
|
|
|
|
const { data } = await api.get(
|
|
|
|
|
`/api/${dbTable}/to_excel/?${resultParams.toString()}`,
|
|
|
|
|
`https://postamates.spatialsystems.ru/api/${dbTable}/to_excel/?${resultParams.toString()}`,
|
|
|
|
|
{ responseType: "arraybuffer" }
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
@ -67,7 +67,7 @@ export const exportPoints = async (params, region, dbTable = "placement_points")
|
|
|
|
|
|
|
|
|
|
export const downloadImportTemplate = async () => {
|
|
|
|
|
const { data } = await api.get(
|
|
|
|
|
'/api/pre_placement_points/download_template/',
|
|
|
|
|
'https://postamates.spatialsystems.ru/api/pre_placement_points/download_template/',
|
|
|
|
|
{ responseType: "arraybuffer" }
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
@ -78,7 +78,7 @@ export const uploadPointsFile = async (file, config) => {
|
|
|
|
|
const formData = new FormData();
|
|
|
|
|
formData.append("file", file);
|
|
|
|
|
const { data } = await api.post(
|
|
|
|
|
`/api/pre_placement_points/load_matching_file/`,
|
|
|
|
|
`https://postamates.spatialsystems.ru/api/pre_placement_points/load_matching_file/`,
|
|
|
|
|
formData,
|
|
|
|
|
config
|
|
|
|
|
);
|
|
|
|
|
@ -90,7 +90,7 @@ export const importPoints = async (id) => {
|
|
|
|
|
const formData = new FormData();
|
|
|
|
|
formData.append("id", id);
|
|
|
|
|
const { data } = await api.post(
|
|
|
|
|
`/api/pre_placement_points/start_matching/`,
|
|
|
|
|
`https://postamates.spatialsystems.ru/api/pre_placement_points/start_matching/`,
|
|
|
|
|
formData
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
@ -99,7 +99,7 @@ export const importPoints = async (id) => {
|
|
|
|
|
|
|
|
|
|
export const getImportStatus = async () => {
|
|
|
|
|
const { data } = await api.get(
|
|
|
|
|
`/api/pre_placement_points/import_status/`
|
|
|
|
|
`https://postamates.spatialsystems.ru/api/pre_placement_points/import_status/`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
@ -199,7 +199,7 @@ export const useMergePointsToDb = () => {
|
|
|
|
|
return useMutation({
|
|
|
|
|
mutationFn: () => {
|
|
|
|
|
return api.post(
|
|
|
|
|
`/api/pre_placement_points/move_points/`
|
|
|
|
|
`https://postamates.spatialsystems.ru/api/pre_placement_points/move_points/`
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
@ -209,7 +209,7 @@ export const useGetPermissions = () => {
|
|
|
|
|
return "editor"
|
|
|
|
|
// const { setImportMode } = useMode();
|
|
|
|
|
// return useQuery(["permissions"], async () => {
|
|
|
|
|
// const { data } = await api.get("/api/me/");
|
|
|
|
|
// const { data } = await api.get("https://postamates.spatialsystems.ru/api/me/");
|
|
|
|
|
|
|
|
|
|
// if (data?.groups?.includes("postnet_editor")) {
|
|
|
|
|
// return "editor";
|
|
|
|
|
@ -228,7 +228,7 @@ export const useUpdatePostamatId = () => {
|
|
|
|
|
return useMutation({
|
|
|
|
|
mutationFn: (params) => {
|
|
|
|
|
return api.put(
|
|
|
|
|
`/api/placement_points/update_postamat_id/?${params.toString()}`
|
|
|
|
|
`https://postamates.spatialsystems.ru/api/placement_points/update_postamat_id/?${params.toString()}`
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
@ -236,7 +236,7 @@ export const useUpdatePostamatId = () => {
|
|
|
|
|
|
|
|
|
|
export const getLastMLRun = async () => {
|
|
|
|
|
const { data } = await api.get(
|
|
|
|
|
`/api/placement_points/last_time_ml_run/`
|
|
|
|
|
`https://postamates.spatialsystems.ru/api/placement_points/last_time_ml_run/`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
@ -244,7 +244,7 @@ export const getLastMLRun = async () => {
|
|
|
|
|
|
|
|
|
|
export const startML = async () => {
|
|
|
|
|
const { data } = await api.get(
|
|
|
|
|
`/api/placement_points/start/`
|
|
|
|
|
`https://postamates.spatialsystems.ru/api/placement_points/start/`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
@ -252,7 +252,7 @@ export const startML = async () => {
|
|
|
|
|
|
|
|
|
|
export const getPostamatesAndPvzGroups = async () => {
|
|
|
|
|
const { data } = await api.get(
|
|
|
|
|
`/api/postamate_and_pvz_groups/`
|
|
|
|
|
`https://postamates.spatialsystems.ru/api/postamate_and_pvz_groups/`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
@ -269,7 +269,7 @@ export const usePostamatesAndPvzGroups = () => {
|
|
|
|
|
|
|
|
|
|
export const getOtherGroups = async () => {
|
|
|
|
|
const { data } = await api.get(
|
|
|
|
|
`/api/other_object_groups/`
|
|
|
|
|
`https://postamates.spatialsystems.ru/api/other_object_groups/`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
@ -304,7 +304,7 @@ export const useGetPendingPointsRange = (dbTable) => {
|
|
|
|
|
["prediction-max-min", dbTable],
|
|
|
|
|
async () => {
|
|
|
|
|
const { data, isInitialLoading, isFetching } = await api.get(
|
|
|
|
|
`/api/${dbTable}/filters/${statusFilter}`
|
|
|
|
|
`https://postamates.spatialsystems.ru/api/${dbTable}/filters/${statusFilter}`
|
|
|
|
|
);
|
|
|
|
|
return { data, isLoading: isInitialLoading || isFetching };
|
|
|
|
|
},
|
|
|
|
|
@ -348,7 +348,7 @@ export const useGetPopupPoints = (features) => {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { data } = await api.get(
|
|
|
|
|
`/api/${dbTable}/?${params.toString()}`
|
|
|
|
|
`https://postamates.spatialsystems.ru/api/${dbTable}/?${params.toString()}`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return data.results;
|
|
|
|
|
@ -366,7 +366,7 @@ export const deletePoint = async (id) => {
|
|
|
|
|
const formData = new FormData();
|
|
|
|
|
formData.append("ids", id);
|
|
|
|
|
await api.delete(
|
|
|
|
|
`/api/pre_placement_points/delete_points/`,
|
|
|
|
|
`https://postamates.spatialsystems.ru/api/pre_placement_points/delete_points/`,
|
|
|
|
|
{ data: formData }
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|