Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1718 Rev 1966
Línea 114... Línea 114...
114
  const dispatch = useDispatch()
114
  const dispatch = useDispatch()
Línea 115... Línea 115...
115
 
115
 
Línea 116... Línea 116...
116
  const { handleSubmit, setValue, register, reset, getValues } = useForm()
116
  const { handleSubmit, setValue, register, reset, getValues } = useForm()
117
 
117
 
118
  const onSubmit = handleSubmit(({ message }) => {
-
 
119
    const formData = new FormData()
118
  const onSubmit = handleSubmit(({ message }) => {
-
 
119
    axios
-
 
120
      .post(sendUrl, { message: emojione.toShort(message) })
Línea -... Línea 121...
-
 
121
      .then((response) => {
120
 
122
        const { success, data } = response.data
121
    formData.append('message', emojione.toShort(message))
123
 
Línea 122... Línea 124...
122
 
124
        if (!success) {
123
    axios.post(sendUrl, formData).then((response) => {
125
          const errorMessage =
124
      const { success, data } = response.data
126
            typeof data === 'string' ? data : 'Ha ocurrido un error'
-
 
127
 
Línea 125... Línea 128...
125
 
128
          setShowEmojione(false)
126
      if (!success) {
-
 
127
        const errorMessage =
-
 
128
          typeof data === 'string' ? data : 'Ha ocurrido un error'
-
 
129
 
-
 
130
        setShowEmojione(false)
-
 
131
        dispatch(addNotification({ style: 'danger', msg: errorMessage }))
129
          dispatch(addNotification({ style: 'danger', msg: errorMessage }))
132
        return
130
          return
133
      }
131
        }
134
 
132
 
Línea 135... Línea 133...
135
      setShowEmojione(false)
133
        setShowEmojione(false)
136
      onComplete()
134
        onComplete()
137
      reset()
-
 
138
    })
-
 
Línea 139... Línea 135...
139
  })
135
        reset()
140
 
136
      })
141
  const sendFile = (file) => {
137
  })
142
    setIsSending(true)
138
 
143
    const formData = new FormData()
139
  const sendFile = (file) => {
144
    formData.append('file', file)
140
    setIsSending(true)
145
 
141