listar reservas

This commit is contained in:
Mariela 2022-08-24 00:07:11 -06:00
parent 0e9c92f744
commit 069b4592b1
2 changed files with 10 additions and 11 deletions

View File

@ -23,15 +23,12 @@ export class Reservation {
@Prop() @Prop()
common_area_name: string; common_area_name: string;
@Prop()
community_id: string;
@Prop() @Prop()
user_id: string; user_id: string;
@Prop() @Prop()
community_id: string; community_id: string;
} }
export const ReservationSchema = SchemaFactory.createForClass(Reservation); export const ReservationSchema = SchemaFactory.createForClass(Reservation);

View File

@ -88,7 +88,6 @@ const Reservations = () => {
} else if (item.status == '0') { } else if (item.status == '0') {
item.status_text = 'Inactivo'; item.status_text = 'Inactivo';
} }
tenants.find((item2) => item2._id == item.user_id);
}) })
setReservations(data) setReservations(data)
@ -104,8 +103,11 @@ const Reservations = () => {
}, []) }, [])
tenants.map((item) => { reservations.map((item) => {
let tenant = tenants.find(item2 => item2._id == item.user_id);
if(tenant){
item.user_name = tenant.name + ' ' + tenant.last_name;
}
}); });
@ -211,7 +213,7 @@ const Reservations = () => {
<p> <p>
{' '} {' '}
<FontAwesomeIcon icon={faUserAlt} style={{ color: '#C08135' }} />{' '} <FontAwesomeIcon icon={faUserAlt} style={{ color: '#C08135' }} />{' '}
Usuario Inquilino
</p> </p>
</> </>
); );
@ -222,7 +224,7 @@ const Reservations = () => {
<p> <p>
{' '} {' '}
<FontAwesomeIcon icon={faHome} style={{ color: '#D7A86E' }} />{' '} <FontAwesomeIcon icon={faHome} style={{ color: '#D7A86E' }} />{' '}
Código de Area Área Reservada
</p> </p>
</> </>
); );
@ -305,7 +307,7 @@ const Reservations = () => {
alignFrozen="left" alignFrozen="left"
></Column> ></Column>
<Column <Column
field="user_id" field="user_name"
header={headerUser} header={headerUser}
style={{ style={{
flexGrow: 1, flexGrow: 1,
@ -315,7 +317,7 @@ const Reservations = () => {
}} }}
></Column> ></Column>
<Column <Column
field="common_area_id" field="common_area_name"
header={headerArea} header={headerArea}
style={{ style={{
flexGrow: 1, flexGrow: 1,