reverse-proxy-frontend/src/features/server/reducer.js

28 lines
669 B
JavaScript
Raw Normal View History

2020-05-06 16:12:11 +03:00
import * as types from "./actionTypes";
import initialState from "../../redux/reducers/initialState";
export default function serverReducer(state = initialState.server, action) {
2020-05-06 16:12:11 +03:00
switch (action.type) {
2020-05-19 02:18:43 +03:00
case types.LOAD_SERVER_DATA_SUCCESS:
2020-05-06 16:12:11 +03:00
return {
...state,
2020-05-19 02:18:43 +03:00
data: { ...action.payload, loading: false, loaded: true }
2020-05-06 16:12:11 +03:00
};
2020-05-06 16:29:52 +03:00
case types.LOAD_SYSTEM_VERSION_SUCCESS:
return {
...state,
...action.payload
};
2020-05-15 01:15:40 +03:00
case types.LOAD_ACTIVE_SESSION_SUCCESS:
return {
...state,
2020-05-15 02:02:36 +03:00
activeSession: { ...action.payload, loading: false, loaded: true }
2020-05-15 01:15:40 +03:00
};
2020-05-06 16:12:11 +03:00
default:
return state;
}
}