The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

27 lines
647 B

  1. import api from '../api';
  2. export const FILTERS_FETCH_REQUEST = 'FILTERS_FETCH_REQUEST';
  3. export const FILTERS_FETCH_SUCCESS = 'FILTERS_FETCH_SUCCESS';
  4. export const FILTERS_FETCH_FAIL = 'FILTERS_FETCH_FAIL';
  5. export const fetchFilters = () => (dispatch, getState) => {
  6. dispatch({
  7. type: FILTERS_FETCH_REQUEST,
  8. skipLoading: true,
  9. });
  10. api(getState)
  11. .get('/api/v1/filters')
  12. .then(({ data }) => dispatch({
  13. type: FILTERS_FETCH_SUCCESS,
  14. filters: data,
  15. skipLoading: true,
  16. }))
  17. .catch(err => dispatch({
  18. type: FILTERS_FETCH_FAIL,
  19. err,
  20. skipLoading: true,
  21. skipAlert: true,
  22. }));
  23. };