Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 12793 Rev 12797
Línea 4... Línea 4...
4
import DescriptionInput from '../../../shared/DescriptionInput'
4
import DescriptionInput from '../../../shared/DescriptionInput'
Línea 5... Línea 5...
5
 
5
 
Línea 6... Línea 6...
6
const SectionModal = ({ show, closeModal, section, onSubmit }) => {
6
const SectionModal = ({ show, closeModal, section, onSubmit }) => {
-
 
7
 
Línea 7... Línea 8...
7
 
8
	const { handleSubmit, errors, register, setValue } = useForm()
8
	const { handleSubmit, errors, register, setValue } = useForm()
9
	const uuid = Math.random() * (9999999999999 - 1000000000000) + 1
9
 
10
 
Línea 10... Línea 11...
10
	useEffect(() => {
11
	useEffect(() => {
-
 
12
		setValue('name', section.name)
-
 
13
	}, [section])
-
 
14
 
-
 
15
	const submit = (data) => {
11
		setValue('name', section.name)
16
		onSubmit({
-
 
17
			...section,
12
	}, [section])
18
			name: data.name,
13
 
19
			text: data.text,
Línea 14... Línea 20...
14
	const submit = (data) => {
20
			slug_section: `section${parseInt(uuid)}`
15
		onSubmit({ ...section, name: data.name, text: data.text })
21
		})