text: import { GenreController } from '@/controllers';
  
  export const TYPES = {
    ALL_GENRES: 'ALL_GENRES',
    ALL_GENRES_REQUEST: 'ALL_GENRES_REQUEST',
    ALL_GENRES_ERROR: 'ALL_GENRES_ERROR',
    ALL_GENRES_SUCCESS: 'ALL_GENRES_SUCCESS',
  };
  
  const allGenresRequest = () => ({
    type: TYPES.ALL_GENRES_REQUEST,
    payload: null,
  });
  
  const allGenresError = error => ({
    type: TYPES.ALL_GENRES_ERROR,
    payload: { error },
  });
  
  const allGenresSuccess = allGenres => ({
    type: TYPES.ALL_GENRES_SUCCESS,
    payload: { allGenres },
  });
  
  export const getAllGenresRequest = () => async dispatch => {
    dispatch(allGenresRequest());
    try {
      const allGenres = await GenreController.getAllGenres();
      dispatch(allGenresSuccess(allGenres));
    } catch (error) {
      dispatch(allGenresError(error.status_message));
    }
  };
  