Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6350 Rev 6351
Línea 32... Línea 32...
32
 
32
 
33
  const onSubmitHandler = async ({ aptitudes }) => {
33
  const onSubmitHandler = async ({ aptitudes }) => {
Línea 34... Línea 34...
34
    setModalLoading(true)
34
    setModalLoading(true)
35
 
-
 
36
    const formData = new FormData()
-
 
37
    aptitudes[0]
-
 
38
      ? formData.append('aptitudes[]', '')
35
 
39
      : aptitudes.map((aptitude) =>
-
 
Línea 40... Línea 36...
40
          formData.append('aptitudes[]', aptitude.value)
36
    const formData = new FormData()
41
        )
37
    aptitudes.map((aptitude) => formData.append('aptitudes[]', aptitude.value))
42
 
38
 
43
    axios
39
    axios
Línea 55... Línea 51...
55
          addNotification({ style: 'success', msg: 'Registro actualizado' })
51
          addNotification({ style: 'success', msg: 'Registro actualizado' })
56
        )
52
        )
Línea 57... Línea 53...
57
 
53
 
58
        onClose()
54
        onClose()
-
 
55
      })
-
 
56
      .catch((error) => {
-
 
57
        dispatch(addNotification({ style: 'danger', msg: error }))
-
 
58
        throw new Error(error)
59
      })
59
      })
60
    setModalLoading(false)
60
      .finally(() => setModalLoading(false))
Línea 61... Línea 61...
61
  }
61
  }
62
 
62
 
63
  useEffect(() => {
-
 
64
    register('aptitudes')
63
  useEffect(() => {
Línea -... Línea 64...
-
 
64
    register('aptitudes')
-
 
65
  }, [])
-
 
66
 
-
 
67
  useEffect(() => {
65
    setValue('aptitudes', userAptitudes)
68
    show ? setValue('aptitudes', userAptitudes) : setValue('aptitudes', [''])
66
  }, [])
69
  }, [show])
67
 
70
 
68
  return (
71
  return (
69
    <Modal show={show} onHide={onClose}>
72
    <Modal show={show} onHide={onClose}>