64 lines
1001 B
JavaScript
64 lines
1001 B
JavaScript
import { HYDRATE } from 'next-redux-wrapper';
|
|
|
|
import * as actionTypes from '../constants/actionTypes';
|
|
import initialState from "./initialState";
|
|
|
|
const supportReducer = (state = initialState.support, action) =>
|
|
{
|
|
switch (action.type)
|
|
{
|
|
case HYDRATE:
|
|
{
|
|
return {
|
|
...state,
|
|
...action.payload.support,
|
|
};
|
|
}
|
|
|
|
case actionTypes.SUPPORT_THEMES:
|
|
{
|
|
return {
|
|
...state,
|
|
themes: action.data.themes,
|
|
};
|
|
}
|
|
|
|
case actionTypes.SUPPORT_THEMES_FILTERED:
|
|
{
|
|
return {
|
|
...state,
|
|
filtered: action.data.filtered,
|
|
};
|
|
}
|
|
|
|
case actionTypes.SUPPORT_APPEALS:
|
|
{
|
|
return {
|
|
...state,
|
|
appeals: { ...state.appeals, ...action.data.appeals, },
|
|
};
|
|
}
|
|
|
|
case actionTypes.SUPPORT_APPEAL:
|
|
{
|
|
return {
|
|
...state,
|
|
appeal: action.data.appeal,
|
|
};
|
|
}
|
|
|
|
case actionTypes.SUPPORT_RESET:
|
|
{
|
|
return {
|
|
...state,
|
|
appeal: action.data.appeal,
|
|
};
|
|
}
|
|
|
|
default: {
|
|
return state;
|
|
}
|
|
}
|
|
};
|
|
|
|
export default supportReducer; |