fix: Fix bugs

This commit is contained in:
2025-06-07 19:40:54 +03:00
parent 0fe4683683
commit e37f9e14bc
11 changed files with 99 additions and 61 deletions

View File

@ -1,4 +1,4 @@
import { authInstance } from "@shared";
import { authInstance, languageInstance } from "@shared";
import { makeAutoObservable, runInAction } from "mobx";
type City = {
@ -11,7 +11,9 @@ type City = {
class CityStore {
cities: City[] = [];
ruCities: City[] = [];
city: City | null = null;
constructor() {
makeAutoObservable(this);
}
@ -24,6 +26,14 @@ class CityStore {
});
};
getRuCities = async () => {
const response = await languageInstance("ru").get("/city");
runInAction(() => {
this.ruCities = response.data;
});
};
deleteCity = async (id: number) => {
await authInstance.delete(`/city/${id}`);