12345678910111213141516171819202122232425262728293031323334 |
- import * as actionTypes from '../../../constants/admin';
- import initialState from '../../initialState';
- export default function newTopic(state = initialState.newTopic, {payload, type, error}) {
- switch (type) { // payload.type -> type
- case actionTypes.CHANGE_TEST_REQUEST: {
- return {
- ...state,
- isFetching: false,
- // payload
- }
- }
- case actionTypes.CHANGE_TOPIC_REQUEST_SUCCESS: {
- const {data:{topic}}=payload
- return {
- ...state,
- isFetching: true,
- data:topic
- }
- }
- // case actionTypes.CREATE_TOPICS_REQUEST_FAILURE: {
- // return {
- // ...state,
- // isFetching: false,
- // error
- // }
- // }
- default: {
- return state;
- }
- }
- }
|