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