2023-10-02 15:47:51 +03:00

46 lines
802 B
JavaScript

import { HYDRATE } from 'next-redux-wrapper';
import * as actionTypes from '../constants/actionTypes';
import initialState from "./initialState";
const edoReducer = (state = initialState.edo, action) =>
{
switch (action.type)
{
case actionTypes.EDO_LOADED:
{
return {
...state,
loaded: action.data.loaded,
};
}
case actionTypes.EDO_OPERATORS_LIST:
{
console.log("actionTypes.EDO_OPERATORS_LIST", actionTypes.EDO_OPERATORS_LIST, { action });
console.log({
...state,
operators: action.data.operators,
});
return {
...state,
operators: action.data.operators,
};
}
case actionTypes.EDO_RESET:
{
return {
loaded: false,
operators: null,
};
}
default: {
return state;
}
}
};
export default edoReducer;