2017-03-03 18:31:42 +03:00
|
|
|
import ApplicationAdapter from './application';
|
|
|
|
|
2022-02-02 19:57:22 +03:00
|
|
|
export default class Theme extends ApplicationAdapter {
|
2017-03-03 18:31:42 +03:00
|
|
|
activate(model) {
|
|
|
|
let url = `${this.buildURL('theme', model.get('id'))}activate/`;
|
|
|
|
|
|
|
|
return this.ajax(url, 'PUT', {data: {}}).then((data) => {
|
2017-03-14 16:54:58 +03:00
|
|
|
this.store.pushPayload(data);
|
|
|
|
return model;
|
2017-03-03 18:31:42 +03:00
|
|
|
});
|
|
|
|
}
|
2023-01-06 15:44:27 +03:00
|
|
|
|
|
|
|
active() {
|
|
|
|
let url = `${this.buildURL('theme', 'active')}`;
|
|
|
|
|
|
|
|
return this.ajax(url, 'GET', {data: {}}).then((data) => {
|
|
|
|
this.store.pushPayload('theme', data);
|
|
|
|
return this.store.peekAll('theme').filterBy('name', data.themes[0].name).firstObject;
|
|
|
|
});
|
|
|
|
}
|
2022-02-02 19:57:22 +03:00
|
|
|
}
|