quitar comunidad id de formulario al cancelar y actualizar

This commit is contained in:
Mariela 2022-08-22 20:13:09 -06:00
parent 01bd394a0d
commit efbdd0b78c
2 changed files with 6 additions and 7 deletions

View File

@ -82,7 +82,6 @@ export class UsersController {
@MessagePattern({ cmd: 'updateAdminCommunity' }) @MessagePattern({ cmd: 'updateAdminCommunity' })
updateAdminCommunity(@Payload() user: UserDocument) { updateAdminCommunity(@Payload() user: UserDocument) {
console.log(user);
return this.userService.update(user._id, user); return this.userService.update(user._id, user);
} }

View File

@ -317,6 +317,7 @@ const AdministradoresComunidad = () => {
toast.current.show({ severity: 'success', summary: 'Exito', detail: 'Administrador de Comunidad de vivienda Actualizada', life: 3000 }); toast.current.show({ severity: 'success', summary: 'Exito', detail: 'Administrador de Comunidad de vivienda Actualizada', life: 3000 });
listaAdmin(); listaAdmin();
setCommunityId('');
setAdminCommunity(emptyAdminCommunity); setAdminCommunity(emptyAdminCommunity);
}) })
@ -352,7 +353,6 @@ const AdministradoresComunidad = () => {
const editAdmin = (admin) => { const editAdmin = (admin) => {
setAdminCommunity(admin); setAdminCommunity(admin);
console.log(admin);
setSaveButtonTitle('Actualizar'); setSaveButtonTitle('Actualizar');
setCommunityId(admin.community_id) setCommunityId(admin.community_id)
} }
@ -361,7 +361,7 @@ const AdministradoresComunidad = () => {
const cancelEdit = () => { const cancelEdit = () => {
setAdminCommunity(emptyAdminCommunity); setAdminCommunity(emptyAdminCommunity);
setSaveButtonTitle('Registrar'); setSaveButtonTitle('Registrar');
setC setCommunityId('');
} }
const actionsAdminCommunity = (rowData) => { const actionsAdminCommunity = (rowData) => {
@ -621,7 +621,7 @@ const AdministradoresComunidad = () => {
<div className="p-0 col-12 md:col-12"> <div className="p-0 col-12 md:col-12">
<div className="p-inputgroup"> <div className="p-inputgroup">
<span className="p-inputgroup-addon p-button p-icon-input-khaki"> <span className="p-inputgroup-addon p-button p-icon-input-khaki">
<i className="pi pi-home"></i> <i className="pi pi-user"></i>
</span> </span>
<InputText id="name" value={adminCommunity.name} onChange={(e) => onInputChange(e, 'name')} required autoFocus className={classNames({ 'p-invalid': submitted && adminCommunity.name === '' })} /> <InputText id="name" value={adminCommunity.name} onChange={(e) => onInputChange(e, 'name')} required autoFocus className={classNames({ 'p-invalid': submitted && adminCommunity.name === '' })} />
</div> </div>
@ -633,7 +633,7 @@ const AdministradoresComunidad = () => {
<div className="p-0 col-12 md:col-12"> <div className="p-0 col-12 md:col-12">
<div className="p-inputgroup"> <div className="p-inputgroup">
<span className="p-inputgroup-addon p-button p-icon-input-khaki"> <span className="p-inputgroup-addon p-button p-icon-input-khaki">
<i className="pi pi-home"></i> <i className="pi pi-user"></i>
</span> </span>
<InputText id="last_name" value={adminCommunity.last_name} onChange={(e) => onInputChange(e, 'last_name')} required autoFocus className={classNames({ 'p-invalid': submitted && adminCommunity.last_name === '' })} /> <InputText id="last_name" value={adminCommunity.last_name} onChange={(e) => onInputChange(e, 'last_name')} required autoFocus className={classNames({ 'p-invalid': submitted && adminCommunity.last_name === '' })} />
</div> </div>
@ -645,7 +645,7 @@ const AdministradoresComunidad = () => {
<div className="p-0 col-12 md:col-12"> <div className="p-0 col-12 md:col-12">
<div className="p-inputgroup"> <div className="p-inputgroup">
<span className="p-inputgroup-addon p-button p-icon-input-khaki"> <span className="p-inputgroup-addon p-button p-icon-input-khaki">
<i className="pi pi-home"></i> <i className="pi pi-at"></i>
</span> </span>
<InputText id="email" value={adminCommunity.email} onChange={(e) => onInputChange(e, 'email')} required autoFocus className={classNames({ 'p-invalid': submitted && adminCommunity.email === '' })} /> <InputText id="email" value={adminCommunity.email} onChange={(e) => onInputChange(e, 'email')} required autoFocus className={classNames({ 'p-invalid': submitted && adminCommunity.email === '' })} />
</div> </div>
@ -658,7 +658,7 @@ const AdministradoresComunidad = () => {
<div className="p-0 col-12 md:col-12"> <div className="p-0 col-12 md:col-12">
<div className="p-inputgroup"> <div className="p-inputgroup">
<span className="p-inputgroup-addon p-button p-icon-input-khaki"> <span className="p-inputgroup-addon p-button p-icon-input-khaki">
<i className="pi pi-home"></i> <i className="pi pi-id-card"></i>
</span> </span>
<InputText id="dni" value={adminCommunity.dni} onChange={(e) => onInputChange(e, 'dni')} required autoFocus className={classNames({ 'p-invalid': submitted && adminCommunity.dni === '' })} /> <InputText id="dni" value={adminCommunity.dni} onChange={(e) => onInputChange(e, 'dni')} required autoFocus className={classNames({ 'p-invalid': submitted && adminCommunity.dni === '' })} />
</div> </div>