From 069b4592b121a8ac4a2786272c38b792fc209268 Mon Sep 17 00:00:00 2001 From: Mariela Date: Wed, 24 Aug 2022 00:07:11 -0600 Subject: [PATCH] listar reservas --- .../src/schemas/reservation.schema.ts | 5 +---- web-ui/web-react/src/components/Reservaciones.js | 16 +++++++++------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/servicio-reservaciones/src/schemas/reservation.schema.ts b/servicio-reservaciones/src/schemas/reservation.schema.ts index a9ebd5b1..c51bf2d9 100644 --- a/servicio-reservaciones/src/schemas/reservation.schema.ts +++ b/servicio-reservaciones/src/schemas/reservation.schema.ts @@ -23,15 +23,12 @@ export class Reservation { @Prop() common_area_name: string; - - @Prop() - community_id: string; - @Prop() user_id: string; @Prop() community_id: string; + } export const ReservationSchema = SchemaFactory.createForClass(Reservation); diff --git a/web-ui/web-react/src/components/Reservaciones.js b/web-ui/web-react/src/components/Reservaciones.js index 06be073d..f14d9adf 100644 --- a/web-ui/web-react/src/components/Reservaciones.js +++ b/web-ui/web-react/src/components/Reservaciones.js @@ -88,7 +88,6 @@ const Reservations = () => { } else if (item.status == '0') { item.status_text = 'Inactivo'; } - tenants.find((item2) => item2._id == item.user_id); }) 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 = () => {

{' '} {' '} - Usuario + Inquilino

); @@ -222,7 +224,7 @@ const Reservations = () => {

{' '} {' '} - Código de Area + Área Reservada

); @@ -305,7 +307,7 @@ const Reservations = () => { alignFrozen="left" > { }} >