koel/resources/assets/js/stores/setting.js
2016-06-26 00:05:24 +08:00

22 lines
372 B
JavaScript

import { http } from '../services';
import stub from '../stubs/settings';
export const settingStore = {
stub,
state: {
settings: [],
},
init(settings) {
this.state.settings = settings;
},
get all() {
return this.state.settings;
},
update(successCb = null, errorCb = null) {
http.post('settings', this.all, successCb, errorCb);
},
};