feat: big major update

This commit is contained in:
2026-02-02 04:00:37 +03:00
parent bbab6fc46a
commit d557664b25
34 changed files with 1801 additions and 665 deletions

View File

@@ -1,5 +1,10 @@
import { makeAutoObservable, runInAction } from "mobx";
import { authInstance, languageInstance, languageStore } from "@shared";
import {
authInstance,
languageInstance,
languageStore,
isMediaIdEmpty,
} from "@shared";
export type Route = {
route_name: string;
@@ -9,6 +14,7 @@ export type Route = {
center_longitude: number;
governor_appeal: number;
id: number;
icon: string;
path: number[][];
rotate: number;
route_direction: boolean;
@@ -137,6 +143,7 @@ class RouteStore {
center_longitude: "",
governor_appeal: 0,
id: 0,
icon: "",
path: [] as number[][],
rotate: 0,
route_direction: false,
@@ -152,9 +159,15 @@ class RouteStore {
};
editRoute = async (id: number) => {
if (!this.editRouteData.video_preview) {
if (
!this.editRouteData.video_preview ||
isMediaIdEmpty(this.editRouteData.video_preview)
) {
delete this.editRouteData.video_preview;
}
if (!this.editRouteData.icon || isMediaIdEmpty(this.editRouteData.icon)) {
delete (this.editRouteData as any).icon;
}
const dataToSend: any = {
...this.editRouteData,
center_latitude: parseFloat(this.editRouteData.center_latitude),