feat: Add edit/create/list
sight page
This commit is contained in:
25
src/shared/store/CityStore/index.tsx
Normal file
25
src/shared/store/CityStore/index.tsx
Normal file
@ -0,0 +1,25 @@
|
||||
import { authInstance } from "@shared";
|
||||
import { makeAutoObservable } from "mobx";
|
||||
|
||||
type City = {
|
||||
id: number;
|
||||
name: string;
|
||||
country_code: string;
|
||||
country: string;
|
||||
arms?: string;
|
||||
};
|
||||
|
||||
class CityStore {
|
||||
cities: City[] = [];
|
||||
|
||||
constructor() {
|
||||
makeAutoObservable(this);
|
||||
}
|
||||
|
||||
getCities = async () => {
|
||||
const response = await authInstance.get("/city");
|
||||
this.cities = response.data;
|
||||
};
|
||||
}
|
||||
|
||||
export const cityStore = new CityStore();
|
Reference in New Issue
Block a user