implement fetching apps from BE
impl install modal
This commit is contained in:
parent
a3adcfc3da
commit
5b728d35d7
24 changed files with 649 additions and 163 deletions
39
src/services/apps/redux/reducers.ts
Normal file
39
src/services/apps/redux/reducers.ts
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import { AppActionTypes } from './actions';
|
||||
|
||||
const initialUsersState: any = {
|
||||
users: [],
|
||||
user: {},
|
||||
userModalLoading: false,
|
||||
usersLoading: false,
|
||||
};
|
||||
|
||||
const appsReducer = (state: any = initialUsersState, action: any) => {
|
||||
switch (action.type) {
|
||||
case AppActionTypes.FETCH_APPS:
|
||||
return {
|
||||
...state,
|
||||
apps: action.payload,
|
||||
};
|
||||
case AppActionTypes.SET_APP_LOADING:
|
||||
return {
|
||||
...state,
|
||||
appLoading: action.payload,
|
||||
};
|
||||
case AppActionTypes.SET_APPS_LOADING:
|
||||
return {
|
||||
...state,
|
||||
appsLoading: action.payload,
|
||||
};
|
||||
case AppActionTypes.FETCH_APP:
|
||||
case AppActionTypes.UPDATE_APP:
|
||||
case AppActionTypes.INSTALL_APP:
|
||||
return {
|
||||
...state,
|
||||
currentApp: action.payload,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
|
||||
export default appsReducer;
|
||||
Reference in a new issue