12345678910111213141516171819202122232425262728293031323334 |
- 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;
- }
- }
- }
|