Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 7458 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 7458 Rev 7460
Línea 35... Línea 35...
35
  type: feedActionTypes.SET_CURRENT_PAGE,
35
  type: feedActionTypes.SET_CURRENT_PAGE,
36
  payload: page,
36
  payload: page,
37
});
37
});
Línea 38... Línea 38...
38
 
38
 
39
export const fetchFeeds = (url, page) => {
-
 
40
  (url);
39
export const fetchFeeds = (url, page) => {
41
  return (dispatch) => {
40
  return (dispatch) => {
42
    dispatch(loadFeeds());
41
    dispatch(loadFeeds());
43
    axios
42
    axios.get(url, {
44
      .get(url + '?page=' + page)
43
      params: { page: page }
45
      .then((res) => {
44
    })
46
        const resData = res.data;
45
      .then(({ data }) => {
47
        (resData);
46
        if (data.success) {
48
        const feeds = resData.data.current.items;
47
          const feeds = data.data.current.items;
49
        const currentPage = resData.data.current.page;
48
          const currentPage = data.data.current.page;
50
        const pages = resData.data.total.pages;
-
 
51
        if (resData.success) {
49
          const pages = data.data.total.pages;
52
          dispatch(loadFeedsSuccess(feeds, currentPage, pages));
50
          dispatch(loadFeedsSuccess(feeds, currentPage, pages));
53
        }
51
        }
54
      })
52
      })
55
      .catch((error) => {
53
      .catch((error) => {