Merge pull request #138 from DeimosPr4/US-56-completar-registro-de-inquilino

completar registro de inquilino
This commit is contained in:
Eduardo Quiros 2022-07-29 21:30:23 -06:00 committed by GitHub
commit fd19e1f0cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 9 deletions

View File

@ -367,8 +367,4 @@ export class AppController {
html(@Body('email') email: string, @Body('name') name: string) { html(@Body('email') email: string, @Body('name') name: string) {
return this.appService.html(email, name); return this.appService.html(email, name);
} }
} }

View File

@ -9,9 +9,8 @@ import { map } from 'rxjs/operators';
export class ReportsService { export class ReportsService {
constructor( constructor(
@InjectModel(Report.name) @InjectModel(Report.name)
private readonly reportModel: Model<ReportDocument>, private readonly reportModel: Model<ReportDocument>, //
) // ) {}
{}
async create(report: ReportDocument): Promise<Report> { async create(report: ReportDocument): Promise<Report> {
return this.reportModel.create(report); return this.reportModel.create(report);

View File

@ -20,8 +20,13 @@ const Inquilinos = () => {
}, []); }, []);
function registrarInquilino() { function registrarInquilino() {
let data = { let data = {
dni: document.getElementById('identificacion').value,
name: document.getElementById('nombre').value,
last_name: document.getElementById('apellidos').value,
phone: document.getElementById('telefono').value,
email: document.getElementById('correo_electronico').value, email: document.getElementById('correo_electronico').value,
community_id: document.getElementById('numero_vivienda').value, community_id: document.getElementById('numero_vivienda').value,
password: document.getElementById('password').value,
user_type: '3', user_type: '3',
status: '1', status: '1',
}; };
@ -48,7 +53,23 @@ const Inquilinos = () => {
<div className="card"> <div className="card">
<h5 className="card-header">Registrar Inquilino</h5> <h5 className="card-header">Registrar Inquilino</h5>
<div className="p-fluid formgrid grid"> <div className="p-fluid formgrid grid">
<div className="p-field col-12 md:col-6"> <div className="field col-12 md:col-6">
<label htmlFor="nombre">Nombre</label>
<InputText type="text" className="form-control" id="nombre" />
</div>
<div className="field col-12 md:col-6">
<label htmlFor="apellidos">Apellidos</label>
<InputText type="text" className="form-control" id="apellidos" />
</div>
<div className="field col-12 md:col-6">
<label htmlFor="identificacion">Identificación</label>
<InputText
type="text"
className="form-control"
id="identificacion"
/>
</div>
<div className="field col-12 md:col-6">
<label htmlFor="correo_electronico">Correo electrónico</label> <label htmlFor="correo_electronico">Correo electrónico</label>
<InputText <InputText
type="email" type="email"
@ -56,7 +77,7 @@ const Inquilinos = () => {
id="correo_electronico" id="correo_electronico"
/> />
</div> </div>
<div className="p-field col-12 md:col-6"> <div className="field col-12 md:col-6">
<label htmlFor="numero_vivienda">Número de Vivienda</label> <label htmlFor="numero_vivienda">Número de Vivienda</label>
<Dropdown <Dropdown
id="numero_vivienda" id="numero_vivienda"
@ -64,6 +85,14 @@ const Inquilinos = () => {
options={communitiesList} options={communitiesList}
/> />
</div> </div>
<div className="field col-12 md:col-6">
<label htmlFor="identificacion">Identificación</label>
<InputText
type="password"
className="form-control"
id="identificacion"
/>
</div>
<Button label="Registrar" onClick={registrarInquilino} /> <Button label="Registrar" onClick={registrarInquilino} />
</div> </div>
</div> </div>