at the end of the day, it was inevitable

This commit is contained in:
Mo Elzubeir
2022-12-09 08:36:26 -06:00
commit 1218570914
1768 changed files with 887087 additions and 0 deletions
@@ -0,0 +1,45 @@
import * as api from '../../../api/dashboardApi'
import ReduxModule from '../abstract/reduxModule'
export const LOAD_DASHBOARDS = 'Load dashboards'
class Dashboards extends ReduxModule {
getNamespace () {
return '[Dashboard]'
}
_loadDashboards ({token, fulfilled}) {
return api
.getDashboards(token)
.then((dashboards) => {
fulfilled(dashboards)
})
}
defineActions () {
const loadDashboards = this.thunkAction(LOAD_DASHBOARDS, this._loadDashboards)
return {
loadDashboards
}
}
getInitialState () {
return {
dashboards: []
}
}
defineReducers () {
return {
[LOAD_DASHBOARDS]: this.setReducer('dashboards')
}
}
}
const dashboards = new Dashboards()
dashboards.init()
export default dashboards