diff --git a/web-ui/web-react/src/components/AdministradoresSistema.js b/web-ui/web-react/src/components/AdministradoresSistema.js index a301c3ed..0edc42b4 100644 --- a/web-ui/web-react/src/components/AdministradoresSistema.js +++ b/web-ui/web-react/src/components/AdministradoresSistema.js @@ -30,6 +30,8 @@ const AdministradoresSistema = () => { const [changeStatusAdminSystemDialog, setChangeStatusAdminSystemDialog] = useState(false); const [changeStatusAdminsSystemDialog, setChangeStatusAdminsSystemDialog] = useState(false); + const [adminDialog, setAdminDialog] = useState(false); + const [submitted, setSubmitted] = useState(false); let emptySysAdmin = { _id: null, @@ -55,7 +57,7 @@ const AdministradoresSistema = () => { item.status_text = 'Activo'; } else if (item.status == '0') { item.status_text = 'Inactivo'; - } + } }) setAdministrators(await data); } @@ -177,6 +179,19 @@ const AdministradoresSistema = () => { setChangeStatusAdminSystemDialog(true); }; + const hideAdminDialog = () => { + setSubmitted(false); + setAdminDialog(false); + setSysAdmin(emptySysAdmin); + + }; + + const infoAdmin = (sysadmin) => { + setSysAdmin({ ...sysadmin }); + setAdminDialog(true); + }; + + const deleteSysAdmin = () => { fetch('http://localhost:4000/user/deleteAdminSystem/' + sysadmin._id, { cache: 'no-cache', @@ -259,6 +274,13 @@ const AdministradoresSistema = () => { return (