import * as actionTypes from '../../../constants/admin'; import initialState from '../../initialState'; export default function deleteTopic(state = initialState.deleteTopic, {payload, type, error}) { switch (type) { case actionTypes.DELETE_TOPIC_REQUEST: { return { ...state, isFetching: true, payload } } case actionTypes.DELETE_TOPIC_REQUEST_SUCCESS: { return { ...state, isFetching: false, payload } } case actionTypes.DELETE_TOPIC_REQUEST_FAILURE: { return { ...state, isFetching: true, error } } default: { return state; } } }