hope 2
This commit is contained in:
@@ -37,8 +37,6 @@ const FormEditProfesor = () => {
|
||||
const [grado_maximo,setGrado_maximo] =useState('');
|
||||
const [grados_obtenidos,setGrados_obtenidos] =useState('');
|
||||
|
||||
const [formData,setFormData] = useState()
|
||||
|
||||
const handlePageChange = (newPage) => {
|
||||
setPage(newPage);
|
||||
};
|
||||
@@ -127,7 +125,7 @@ const FormEditProfesor = () => {
|
||||
const handleSubmit = async (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
const updatedProfesor = {
|
||||
const profesorData = {
|
||||
...profesor,
|
||||
nombre,
|
||||
num_trabajador,
|
||||
@@ -166,10 +164,9 @@ const FormEditProfesor = () => {
|
||||
const response = await fetch(`http://localhost:3000/profesor/${id_profesor}`, {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
body: JSON.stringify(updatedProfesor),
|
||||
body: JSON.stringify(profesorData),
|
||||
});
|
||||
const data = await response.json();
|
||||
console.log('Success:', data);
|
||||
|
||||
Reference in New Issue
Block a user