Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3280 | Rev 3285 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3280 Rev 3283
Línea 37... Línea 37...
37
export const addFeedSuccess = (feed, feedSharedId = '') => ({
37
export const addFeedSuccess = (feed, feedSharedId = '') => ({
38
  type: feedActionTypes.ADD_FEED,
38
  type: feedActionTypes.ADD_FEED,
39
  payload: { feed, feedSharedId }
39
  payload: { feed, feedSharedId }
40
})
40
})
Línea -... Línea 41...
-
 
41
 
-
 
42
export const deleteFeed = (url, id) => {
-
 
43
  return async (dispatch) => {
-
 
44
    const response = await axios.post(url)
-
 
45
    const { data, success } = response.data
-
 
46
 
-
 
47
    if (!success) {
-
 
48
      const err =
-
 
49
        typeof data === 'string' ? data : 'Error al borrar la publicación'
-
 
50
      throw new Error(err)
-
 
51
    }
-
 
52
 
-
 
53
    dispatch(deleteFeed(id))
-
 
54
    return id
-
 
55
  }
-
 
56
}
-
 
57
 
-
 
58
export const deleteFeedSuccess = (feedId) => ({
-
 
59
  type: feedActionTypes.DELETE_FEED,
-
 
60
  payload: feedId
-
 
61
})
41
 
62
 
42
export const updateFeed = ({ feed, uuid }) => ({
63
export const updateFeed = ({ feed, uuid }) => ({
43
  type: feedActionTypes.UPDATE_FEED,
64
  type: feedActionTypes.UPDATE_FEED,
44
  payload: { feed, uuid }
65
  payload: { feed, uuid }
45
})
-
 
46
export const deleteFeed = (feedId) => ({
-
 
47
  type: feedActionTypes.DELETE_FEED,
-
 
48
  payload: feedId
-
 
Línea 49... Línea 66...
49
})
66
})
50
 
67
 
51
export const setCurrentPage = (page) => ({
68
export const setCurrentPage = (page) => ({
52
  type: feedActionTypes.SET_CURRENT_PAGE,
69
  type: feedActionTypes.SET_CURRENT_PAGE,