Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 7073 Rev 7074
Línea 60... Línea 60...
60
      label: 'Me divierte',
60
      label: 'Me divierte',
61
    },
61
    },
62
  ]
62
  ]
Línea 63... Línea 63...
63
 
63
 
64
  const saveReaction = (type) => {
64
  const saveReaction = (type) => {
65
    axios.post(reactionTypesUrl[type]).then((res) => {
65
    axios.post(reactionTypesUrl[type]).then((response) => {
Línea 66... Línea 66...
66
      const { success, data } = res.data
66
      const { success, data } = response.data
67
 
67
 
-
 
68
      if (!success) {
68
      if (!success) {
69
        dispatch(addNotification({ style: 'danger', msg: data }))
Línea 69... Línea 70...
69
        dispatch(addNotification({ style: 'danger', msg: data }))
70
        return
70
      }
71
      }
71
 
72
 
72
      const typeIndex = reactionsOptions.findIndex(
-
 
-
 
73
      const typeIndex = reactionsOptions.findIndex(
-
 
74
        (option) => option.type === type
73
        (option) => option.type === type
75
      )
74
      )
76
      const newReaction = reactionsOptions[typeIndex]
75
 
77
      console.log(newReaction)
76
      onChange(data.reactions)
78
      onChange(data.reactions)
Línea 77... Línea 79...
77
      setSettedReaction(reactionsOptions[typeIndex])
79
      setSettedReaction(newReaction)
78
    })
80
    })