Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 12734 Rev 12738
Línea 4... Línea 4...
4
import { useForm } from 'react-hook-form'
4
import { useForm } from 'react-hook-form'
5
import DescriptionInput from '../../../shared/DescriptionInput'
5
import DescriptionInput from '../../../shared/DescriptionInput'
Línea 6... Línea 6...
6
 
6
 
Línea 7... Línea 7...
7
const SectionModal = ({ show, closeModal, section, onSubmit }) => {
7
const SectionModal = ({ show, closeModal, section, onSubmit }) => {
-
 
8
 
-
 
9
	const { handleSubmit, errors, register } = useForm()
-
 
10
 
-
 
11
	const submit = (data) => {
Línea 8... Línea 12...
8
 
12
		onSubmit({ ...section, name: data.name })
9
	const { handleSubmit, watch, errors, register, setValue } = useForm()
13
	}
10
 
14
 
11
	return (
15
	return (
12
		<Modal size="md" onHide={closeModal} show={show}>
16
		<Modal size="md" onHide={closeModal} show={show}>
13
			<Modal.Header closeButton>
17
			<Modal.Header closeButton>
14
				<Modal.Title>Nuevo candidato</Modal.Title>
18
				<Modal.Title>Nuevo candidato</Modal.Title>
15
			</Modal.Header>
19
			</Modal.Header>
16
			<form onSubmit={handleSubmit(onSubmit({ ...section, name: watch('name'), text: watch('text') }))}>
20
			<form onSubmit={handleSubmit(submit)}>
17
				<Modal.Body>
21
				<Modal.Body>
18
					<div className='form-group'>
22
					<div className='form-group'>