Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

getFilesReducer.js 583B

1234567891011121314151617181920212223242526272829303132
  1. import createReducer from "../../utils/createReducer";
  2. import {
  3. FETCH_FILES_ERR,
  4. FETCH_FILES_SUCCESS,
  5. } from "../../actions/files/fileActionConstants";
  6. const initialState = {
  7. data: {},
  8. fetchFilesErrorMessage: "",
  9. };
  10. export default createReducer(
  11. {
  12. [FETCH_FILES_SUCCESS]: setFiles,
  13. [FETCH_FILES_ERR]: setFilesErrorMessage,
  14. },
  15. initialState
  16. );
  17. function setFiles(state, action) {
  18. return {
  19. ...state,
  20. data: action.payload,
  21. };
  22. }
  23. function setFilesErrorMessage(state, action) {
  24. return {
  25. ...state,
  26. fetchFilesErrorMessage: action.payload,
  27. };
  28. }