import React, { useEffect, useState } from 'react'; import Notification from '../../component/notification'; import Alert from '../../component/alert'; const ChildAdd = () => { const [_success, setSuccess] = useState(''); const [identity, setIdentity] = useState(''); const [textColor, setTextColor] = useState(null); const [showAlert, setShowAlert] = useState(false); const [messageAlert, setMessageAlert] = useState(null); const fatherId = document.getElementById('father_id').value; async function handleClick() { try { if(identity == '') { return; } const formdata = new FormData(); formdata.append('identity', identity); formdata.append('father_id', fatherId); axios.post('/fathers/father-relations/register', formdata) .then(response => { if(response.data.status_code==200){ // const formdata2 = new FormData(); // formdata2.append('father_id ', fatherId); // axios.post('/api/children/registerTemporary', formdata2) // .then(response2 => { // if(response2.data.status_code==200){ // } // }); } else if(response.data.status_code==400){ } }); } catch (error) { console.log('error', error); } } async function handleCloseAlert() { setShowAlert(false); }; return (

子追加

setIdentity(e.target.value)} value={identity} className="input-default input-tel input-h60 input-w480" id="identity" />
{ _success && {_success} }
) } export default ChildAdd;