Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 15128 Rev 15375
Línea 16... Línea 16...
16
	action,
16
	action,
17
	setAction
17
	setAction
18
}) => {
18
}) => {
Línea 19... Línea 19...
19
 
19
 
-
 
20
	// States
20
	// States
21
	const [loading, setLoading] = useState(false)
21
	const [vacancyOptions, setVacancyOptions] = useState(vacancies)
22
	const [vacancyOptions, setVacancyOptions] = useState(vacancies)
22
	const [vacancyUrl, setVacancyUrl] = useState(vacancy_link.replace('UUID_PLACEHOLDER', vacancies[0].uuid))
23
	const [vacancyUrl, setVacancyUrl] = useState(vacancy_link.replace('UUID_PLACEHOLDER', vacancies[0].uuid))
23
	const [typeOptions, setTypeOptions] = useState({
24
	const [typeOptions, setTypeOptions] = useState({
24
		url: type_link,
25
		url: type_link,
Línea 61... Línea 62...
61
	// Hooks
62
	// Hooks
62
	const { setValue, register, watch, handleSubmit } = useForm()
63
	const { setValue, register, watch, handleSubmit } = useForm()
63
	const dispatch = useDispatch()
64
	const dispatch = useDispatch()
Línea 64... Línea 65...
64
 
65
 
-
 
66
	const onSubmit = () => {
65
	const onSubmit = () => {
67
		setLoading(true)
66
		const content = []
68
		const content = []
67
		competencies.forEach(competency => competency.behaviors.forEach(behavior => {
69
		competencies.forEach(competency => competency.behaviors.forEach(behavior => {
68
			content.push({
70
			content.push({
69
				competencyUuid: behavior.competency_uuid,
71
				competencyUuid: behavior.competency_uuid,
Línea 97... Línea 99...
97
								}))
99
								}))
98
							)
100
							)
99
						)
101
						)
100
					return
102
					return
101
				}
103
				}
102
 
-
 
103
				setAction('')
104
				setAction('')
104
				dispatch(addNotification({
105
				dispatch(addNotification({
105
					style: 'success',
106
					style: 'success',
106
					msg: `Registro ${action === 'edit' ? 'actualizado' : 'añadido'}`
107
					msg: `Registro ${action === 'edit' ? 'actualizado' : 'añadido'}`
107
				}))
108
				}))
108
			})
109
			})
-
 
110
			.finally(() => setLoading(true))
109
	}
111
	}
Línea 110... Línea 112...
110
 
112
 
111
	useEffect(() => {
113
	useEffect(() => {
112
		if (action === 'edit') {
114
		if (action === 'edit') {
Línea 334... Línea 336...
334
												</select>
336
												</select>
335
											</div>
337
											</div>
336
										</div>
338
										</div>
337
									</div>
339
									</div>
338
									<div className="form-group">
340
									<div className="form-group">
-
 
341
										<button
339
										<button type="submit" className="btn btn-primary btn-form-save-close mr-2">
342
											className="btn btn-primary btn-form-save-close mr-2"
-
 
343
											disabled={loading}
-
 
344
											type="submit"
-
 
345
										>
340
											Guardar
346
											Guardar
341
										</button>
347
										</button>
342
										<button
348
										<button
343
											type="button"
349
											type="button"
344
											className="btn btn-secondary btn-edit-cancel"
350
											className="btn btn-secondary btn-edit-cancel"