init: Init React Application
This commit is contained in:
17
src/shared/store/VehicleStore/index.ts
Normal file
17
src/shared/store/VehicleStore/index.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { API_URL, authInstance } from "@shared";
|
||||
import { makeAutoObservable } from "mobx";
|
||||
|
||||
class VehicleStore {
|
||||
vehicles: any[] = [];
|
||||
|
||||
constructor() {
|
||||
makeAutoObservable(this);
|
||||
}
|
||||
|
||||
getVehicles = async () => {
|
||||
const response = await authInstance.get(`${API_URL}/vehicle`);
|
||||
this.vehicles = response.data;
|
||||
};
|
||||
}
|
||||
|
||||
export const vehicleStore = new VehicleStore();
|
Reference in New Issue
Block a user