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

27 lines
461 B
JavaScript
Raw Normal View History

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