koel/resources/assets/js/stores/setting.js

28 lines
482 B
JavaScript
Raw Normal View History

2015-12-13 04:42:28 +00:00
import http from '../services/http';
import stub from '../stubs/settings';
import sharedStore from './shared';
export default {
stub,
state: {
settings: [],
},
init() {
this.state.settings = sharedStore.state.settings;
},
all() {
return this.state.settings;
},
update(cb = null) {
http.post('settings', this.all(), msg => {
if (cb) {
cb();
}
});
},
};