Proyectos de Subversion LeadersLinked - SPA

Rev

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

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