2015-06-29 15:58:47 +02:00
|
|
|
'use strict';
|
|
|
|
|
2015-10-07 09:31:38 +02:00
|
|
|
import { altWhitelabel } from '../alt';
|
2015-06-29 15:58:47 +02:00
|
|
|
import WhitelabelFetcher from '../fetchers/whitelabel_fetcher';
|
|
|
|
|
|
|
|
|
|
|
|
class WhitelabelActions {
|
|
|
|
constructor() {
|
|
|
|
this.generateActions(
|
|
|
|
'updateWhitelabel'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
fetchWhitelabel() {
|
|
|
|
WhitelabelFetcher.fetch()
|
|
|
|
.then((res) => {
|
2015-07-17 15:41:09 +02:00
|
|
|
if(res && res.whitelabel) {
|
|
|
|
this.actions.updateWhitelabel(res.whitelabel);
|
|
|
|
} else {
|
|
|
|
this.actions.updateWhitelabel({});
|
|
|
|
}
|
2015-06-29 15:58:47 +02:00
|
|
|
})
|
|
|
|
.catch((err) => {
|
2015-07-17 15:41:09 +02:00
|
|
|
console.logGlobal(err);
|
2015-06-29 15:58:47 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-10-07 09:31:38 +02:00
|
|
|
export default altWhitelabel.createActions(WhitelabelActions);
|