feat: update route center calculating

This commit is contained in:
2025-11-26 04:29:19 +03:00
parent 04a9ac452e
commit 95fe297aae
7 changed files with 67 additions and 39 deletions

View File

@@ -123,11 +123,18 @@ class RouteStore {
if (!this.editRouteData.video_preview) {
delete this.editRouteData.video_preview;
}
const response = await authInstance.patch(`/route/${id}`, {
const dataToSend: any = {
...this.editRouteData,
center_latitude: parseFloat(this.editRouteData.center_latitude),
center_longitude: parseFloat(this.editRouteData.center_longitude),
});
};
if (
this.editRouteData.governor_appeal === 0 ||
!this.editRouteData.governor_appeal
) {
dataToSend.governor_appeal = null;
}
const response = await authInstance.patch(`/route/${id}`, dataToSend);
runInAction(() => {
this.route[id] = response.data;