mirror of https://github.com/openspug/spug
25 lines
535 B
JavaScript
25 lines
535 B
JavaScript
import { observable } from "mobx";
|
|
import http from 'libs/http';
|
|
|
|
class Store {
|
|
@observable records = [];
|
|
@observable record = {};
|
|
@observable isFetching = false;
|
|
@observable formVisible = false;
|
|
|
|
@observable f_name;
|
|
|
|
fetchRecords = () => {
|
|
this.isFetching = true;
|
|
return http.get('/api/config/environment/')
|
|
.then(res => this.records = res)
|
|
.finally(() => this.isFetching = false)
|
|
};
|
|
|
|
showForm = (info = {}) => {
|
|
this.formVisible = true;
|
|
this.record = info
|
|
}
|
|
}
|
|
|
|
export default new Store() |