initial state
parent
49fbd7be66
commit
210b0885a1
|
@ -1,6 +1,7 @@
|
||||||
import * as types from "../actions/actionTypes";
|
import * as types from "../actions/actionTypes";
|
||||||
|
import initialState from "./initialState";
|
||||||
|
|
||||||
export default function authorReducer(state = [], action) {
|
export default function authorReducer(state = initialState.authors, action) {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case types.LOAD_AUTHORS_SUCCESS:
|
case types.LOAD_AUTHORS_SUCCESS:
|
||||||
return action.authors;
|
return action.authors;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import * as types from "../actions/actionTypes";
|
import * as types from "../actions/actionTypes";
|
||||||
|
import initialState from "./initialState";
|
||||||
|
|
||||||
export default function courseReducer(state = [], action) {
|
export default function courseReducer(state = initialState.courses, action) {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case types.CREATE_COURSE:
|
case types.CREATE_COURSE:
|
||||||
return [...state, { ...action.course }];
|
return [...state, { ...action.course }];
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
export default {
|
||||||
|
courses: [],
|
||||||
|
authors: []
|
||||||
|
};
|
Loading…
Reference in New Issue