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:
commit
f3f02e41ed
|
@ -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')
|
@Put('user/updateUser/:id')
|
||||||
updateUser(
|
updateUser(
|
||||||
@Param('id') id: string,
|
@Param('id') id: string,
|
||||||
|
|
|
@ -89,6 +89,38 @@ export class AppService {
|
||||||
.pipe(map((message: string) => ({ message })));
|
.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
|
//POST parameter from API
|
||||||
createAdminSystem(dni: string, name: string, last_name: string, email: string, phone: number
|
createAdminSystem(dni: string, name: string, last_name: string, email: string, phone: number
|
||||||
, user_type: string, status: string, date_entry: Date) {
|
, user_type: string, status: string, date_entry: Date) {
|
||||||
|
|
|
@ -6,3 +6,8 @@ help = "Per project developer environments"
|
||||||
[[commands]]
|
[[commands]]
|
||||||
package = "nodejs"
|
package = "nodejs"
|
||||||
help = "Node.js"
|
help = "Node.js"
|
||||||
|
|
||||||
|
[[commands]]
|
||||||
|
package = "nodePackages.expo-cli"
|
||||||
|
help = "Expo CLI"
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,11 @@ export class UsersController {
|
||||||
return this.userService.update(user.id, user);
|
return this.userService.update(user.id, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@MessagePattern({ cmd: 'updateGuard' })
|
||||||
|
updateGuard(@Payload() guard: UserDocument) {
|
||||||
|
return this.userService.update(guard.id, guard);
|
||||||
|
}
|
||||||
|
|
||||||
@MessagePattern({ cmd: 'removeUser' })
|
@MessagePattern({ cmd: 'removeUser' })
|
||||||
remove(@Payload() id: string) {
|
remove(@Payload() id: string) {
|
||||||
let dni = id['dni'];
|
let dni = id['dni'];
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -47,7 +47,6 @@ const Inquilinos = () => {
|
||||||
const [housesList, setHousesList] = useState([])
|
const [housesList, setHousesList] = useState([])
|
||||||
const [submitted, setSubmitted] = useState(false)
|
const [submitted, setSubmitted] = useState(false)
|
||||||
const [infoDialogVisible, setShowInfoDialog] = useState(false)
|
const [infoDialogVisible, setShowInfoDialog] = useState(false)
|
||||||
const [cancelSaveButtonVisible, setCancelSaveButtonVisible] = useState(false)
|
|
||||||
const toast = useRef(null)
|
const toast = useRef(null)
|
||||||
const dt = useRef(null)
|
const dt = useRef(null)
|
||||||
const [cookies] = useCookies()
|
const [cookies] = useCookies()
|
||||||
|
@ -279,7 +278,6 @@ const Inquilinos = () => {
|
||||||
const cancelEdit = () => {
|
const cancelEdit = () => {
|
||||||
setTenant(emptyTenant);
|
setTenant(emptyTenant);
|
||||||
setSaveButtonTitle('Registrar');
|
setSaveButtonTitle('Registrar');
|
||||||
setCancelSaveButtonVisible(false);
|
|
||||||
setHouseNumber('');
|
setHouseNumber('');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -761,7 +759,7 @@ const Inquilinos = () => {
|
||||||
</div>
|
</div>
|
||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
<div className="card">
|
<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="p-fluid formgrid grid">
|
||||||
<div className="field col-12 md:col-6">
|
<div className="field col-12 md:col-6">
|
||||||
<label htmlFor="name">Nombre</label>
|
<label htmlFor="name">Nombre</label>
|
||||||
|
|
Loading…
Reference in New Issue