mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 18:13:49 +01:00
35 lines
852 B
JavaScript
35 lines
852 B
JavaScript
|
'use strict';
|
||
|
|
||
|
import alt from '../alt';
|
||
|
import ApplicationFetcher from '../fetchers/application_fetcher';
|
||
|
|
||
|
|
||
|
class ApplicationActions {
|
||
|
constructor() {
|
||
|
this.generateActions(
|
||
|
'updateApplications'
|
||
|
);
|
||
|
}
|
||
|
|
||
|
fetchApplication() {
|
||
|
ApplicationFetcher.fetch()
|
||
|
.then((res) => {
|
||
|
this.actions.updateApplications(res.applications);
|
||
|
})
|
||
|
.catch((err) => {
|
||
|
console.log(err);
|
||
|
});
|
||
|
}
|
||
|
refreshApplicationToken(applicationName) {
|
||
|
ApplicationFetcher.refreshToken(applicationName)
|
||
|
.then((res) => {
|
||
|
this.actions.updateApplications(res.applications);
|
||
|
})
|
||
|
.catch((err) => {
|
||
|
console.log(err);
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default alt.createActions(ApplicationActions);
|