| 1234567891011121314151617181920212223242526272829303132 |
- import createReducer from "../../utils/createReducer";
- import {
- FETCH_FILES_ERR,
- FETCH_FILES_SUCCESS,
- } from "../../actions/files/fileActionConstants";
-
- const initialState = {
- data: {},
- fetchFilesErrorMessage: "",
- };
-
- export default createReducer(
- {
- [FETCH_FILES_SUCCESS]: setFiles,
- [FETCH_FILES_ERR]: setFilesErrorMessage,
- },
- initialState
- );
-
- function setFiles(state, action) {
- return {
- ...state,
- data: action.payload,
- };
- }
-
- function setFilesErrorMessage(state, action) {
- return {
- ...state,
- fetchFilesErrorMessage: action.payload,
- };
- }
|