Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 10856 Rev 10859
Línea 50... Línea 50...
50
	const history = useHistory()
50
	const history = useHistory()
51
	const dispatch = useDispatch()
51
	const dispatch = useDispatch()
52
	const { action } = useParams()
52
	const { action } = useParams()
Línea 53... Línea 53...
53
 
53
 
54
	const onSubmit = () => {
-
 
55
 
54
	const onSubmit = () => {
56
		const content = []
55
		const content = []
57
		competencies.forEach(competency => competency.behaviors.forEach(behavior => {
56
		competencies.forEach(competency => competency.behaviors.forEach(behavior => {
58
			content.push({
57
			content.push({
59
				competencyUuid: behavior.competency_uuid,
58
				competencyUuid: behavior.competency_uuid,
Línea 68... Línea 67...
68
		submitData.append('candidate_uuid', watch('candidate'))
67
		submitData.append('candidate_uuid', watch('candidate'))
69
		submitData.append('points', watch('points'))
68
		submitData.append('points', watch('points'))
70
		submitData.append('comment', watch('comment'))
69
		submitData.append('comment', watch('comment'))
71
		submitData.append('status', watch('status'))
70
		submitData.append('status', watch('status'))
Línea -... Línea 71...
-
 
71
 
-
 
72
		axios.post(actionLink, submitData)
-
 
73
			.then(({ data }) => {
-
 
74
				if (!data.success) {
72
 
75
					dispatch(addNotification({
73
		console.log(content)
76
						style: 'error',
-
 
77
						msg: 'Ha ocurrido un error'
-
 
78
					}))
-
 
79
				}
74
		console.log(submitData.values)
80
 
-
 
81
				dispatch(addNotification({
-
 
82
					style: 'success',
-
 
83
					msg: `Registro ${action === 'edit' ? 'actualizado' : 'añadido'}`
-
 
84
				}))
75
		console.log(actionLink)
85
			})
Línea 76... Línea 86...
76
	}
86
	}
77
 
87
 
78
	useEffect(() => {
88
	useEffect(() => {