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

23 lines
406 B
JavaScript
Raw Normal View History

2016-06-25 10:15:57 +00:00
import { http } from '../services';
2015-12-13 04:42:28 +00:00
import stub from '../stubs/settings';
2016-06-25 10:15:57 +00:00
export const settingStore = {
2015-12-13 04:42:28 +00:00
stub,
2016-03-13 17:00:32 +00:00
2015-12-13 04:42:28 +00:00
state: {
2016-03-13 17:00:32 +00:00
settings: [],
2015-12-13 04:42:28 +00:00
},
2016-03-13 17:00:32 +00:00
2015-12-29 01:22:38 +00:00
init(settings) {
this.state.settings = settings;
2015-12-13 04:42:28 +00:00
},
2016-03-20 13:42:33 +00:00
get all() {
2015-12-13 04:42:28 +00:00
return this.state.settings;
},
2016-01-01 07:47:03 +00:00
update(successCb = null, errorCb = null) {
2016-03-20 13:42:33 +00:00
http.post('settings', this.all, successCb, errorCb);
2015-12-13 04:42:28 +00:00
},
};