32 lines
507 B
JavaScript
32 lines
507 B
JavaScript
import { HYDRATE } from 'next-redux-wrapper';
|
|
|
|
import * as actionTypes from '../constants/actionTypes';
|
|
import initialState from "./initialState";
|
|
|
|
const contractsReducer = (state = initialState.contracts, action) =>
|
|
{
|
|
switch (action.type)
|
|
{
|
|
case HYDRATE:
|
|
{
|
|
return {
|
|
...state,
|
|
...action.payload.contracts,
|
|
};
|
|
}
|
|
|
|
case actionTypes.CONTRACTS:
|
|
{
|
|
return {
|
|
...state,
|
|
...action.data,
|
|
};
|
|
}
|
|
|
|
default: {
|
|
return state;
|
|
}
|
|
}
|
|
};
|
|
|
|
export default contractsReducer; |