import React, { useState } from 'react'; import { InputText } from 'primereact/inputtext'; import { Button } from 'primereact/button'; const FormAdminSistema = () => { function registrarAdmin() { var data = { dni: "12687", name: "hola", last_name: "buuu", email: "tmora4c@ucenfotec.ac.cr", phone: 84664515, password: "1203", user_type: "1", status: "2" }; console.log(data); fetch('http://localhost:4000/user/createAdminSystem/', { cache: 'no-cache', method: 'POST', body: JSON.stringify(data), headers: { 'Content-Type': 'application/json' } }) .then( function (response) { if (response.status != 200) console.log('Ocurrió un error con el servicio: ' + response.status); else return response.json(); } ) .then( function (response) { console.log(response); } ) .catch( err => console.log('Ocurrió un error con el fetch', err) ); } return (
Registro de un administrador del sistema
) } export default React.memo(FormAdminSistema);