Merge pull request #185 from DeimosPr4/45-us-46-modificar-guarda-de-seguridad

45 us 46 modificar guarda de seguridad
This commit is contained in:
Eduardo Quiros 2022-08-22 11:19:27 +00:00 committed by GitHub
commit f3f02e41ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 711 additions and 569 deletions

View File

@ -82,6 +82,35 @@ export class AppController {
);
}
@Put('user/updateGuard/:id')
updateGuard(
@Param('id') id: string,
@Body('dni') dni: string,
@Body('name') name: string,
@Body('last_name') last_name: string,
@Body('email') email: string,
@Body('phone') phone: number,
@Body('password') password: string,
@Body('user_type') user_type: string,
@Body('status') status: string,
@Body('date_entry') date_entry: Date,
@Body('community_id') community_id: string,
) {
return this.appService.updateGuard(
id,
dni,
name,
last_name,
email,
phone,
password,
user_type,
status,
date_entry,
community_id,
);
}
@Put('user/updateUser/:id')
updateUser(
@Param('id') id: string,

View File

@ -89,6 +89,38 @@ export class AppService {
.pipe(map((message: string) => ({ message })));
}
updateGuard(
_id: string,
dni: string,
name: string,
last_name: string,
email: string,
phone: number,
password: string,
user_type: string,
status: string,
date_entry: Date,
community_id: string,
) {
const pattern = { cmd: 'updateGuard' };
const payload = {
id: _id,
dni: dni,
name: name,
last_name: last_name,
email: email,
phone: phone,
password: password,
user_type: user_type,
status: status,
date_entry: date_entry,
community_id: community_id,
};
return this.clientUserApp
.send<string>(pattern, payload)
.pipe(map((message: string) => ({ message })));
}
//POST parameter from API
createAdminSystem(dni: string, name: string, last_name: string, email: string, phone: number
, user_type: string, status: string, date_entry: Date) {

View File

@ -6,3 +6,8 @@ help = "Per project developer environments"
[[commands]]
package = "nodejs"
help = "Node.js"
[[commands]]
package = "nodePackages.expo-cli"
help = "Expo CLI"

View File

@ -69,6 +69,11 @@ export class UsersController {
return this.userService.update(user.id, user);
}
@MessagePattern({ cmd: 'updateGuard' })
updateGuard(@Payload() guard: UserDocument) {
return this.userService.update(guard.id, guard);
}
@MessagePattern({ cmd: 'removeUser' })
remove(@Payload() id: string) {
let dni = id['dni'];

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,6 @@ const Inquilinos = () => {
const [housesList, setHousesList] = useState([])
const [submitted, setSubmitted] = useState(false)
const [infoDialogVisible, setShowInfoDialog] = useState(false)
const [cancelSaveButtonVisible, setCancelSaveButtonVisible] = useState(false)
const toast = useRef(null)
const dt = useRef(null)
const [cookies] = useCookies()
@ -279,7 +278,6 @@ const Inquilinos = () => {
const cancelEdit = () => {
setTenant(emptyTenant);
setSaveButtonTitle('Registrar');
setCancelSaveButtonVisible(false);
setHouseNumber('');
}
@ -761,7 +759,7 @@ const Inquilinos = () => {
</div>
<div className="col-12">
<div className="card">
<h5>Registro de un administrador de una comunidad de viviendas</h5>
<h5>Registro de un Inquilino</h5>
<div className="p-fluid formgrid grid">
<div className="field col-12 md:col-6">
<label htmlFor="name">Nombre</label>