Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export const initProducts = (address, page, limit) => {
  2.     return dispatch => {
  3.         dispatch(fetchProductsStart());
  4.         axiosInstance.get(`/product/all?address=${address}&page=${page}&limit=${limit}&categoryId=&producerId`)
  5.             .then(response => {
  6.                 const products = response.data;
  7.                 dispatch(fetchProductsSuccess(products))
  8.             })
  9.             .catch(error => {
  10.                 console.log("Error: ", error)
  11.                 dispatch(fetchProductsFailed(error))
  12.             });
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement