Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 14625 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 14625 Rev 15066
Línea 15... Línea 15...
15
	const dispatch = useDispatch()
15
	const dispatch = useDispatch()
Línea 16... Línea 16...
16
 
16
 
Línea 17... Línea 17...
17
	const [status, setStatus] = useState('a')
17
	const [status, setStatus] = useState('a')
18
 
-
 
19
	const onSubmit = () => {
18
 
20
 
19
	const onSubmit = () => {
21
		const submitData = new FormData()
20
		const submitData = new FormData()
22
		submitData.append('name', watch('name'))
21
		submitData.append('name', watch('name'))
23
		submitData.append('description', watch('description'))
22
		submitData.append('description', watch('description'))
Línea 50... Línea 49...
50
					msg: data.data
49
					msg: data.data
51
				}))
50
				}))
52
			})
51
			})
53
	}
52
	}
Línea -... Línea 53...
-
 
53
 
-
 
54
	useEffect(() => {
-
 
55
		axios.get(actionLink)
-
 
56
			.then(({ data }) => {
-
 
57
				if (!data.success) {
-
 
58
					return dispatch(addNotification({
-
 
59
						style: 'danger',
-
 
60
						msg: 'Ha ocurrido un error'
-
 
61
					}))
-
 
62
				}
-
 
63
 
-
 
64
				setValue('name', data.data.name)
-
 
65
				setValue('description', data.data.description)
-
 
66
				setValue('job_description_id', data.data.job_description_id)
-
 
67
				setStatus(data.data.status)
-
 
68
			})
-
 
69
	}, [actionLink])
54
 
70
 
55
	const submitAndClose = () => {
71
	const submitAndClose = () => {
56
		onSubmit()
72
		onSubmit()
57
		reset()
73
		reset()
58
		history.goBack()
74
		history.goBack()