From 04cb3f943cf1a42ab7eff16252289e606c3eabfc Mon Sep 17 00:00:00 2001 From: Pablo Bonilla Date: Tue, 17 Aug 2021 19:33:37 -0600 Subject: [PATCH] Fix home surveys --- src/main/webapp/app/home/home.component.html | 8 +++++--- src/main/webapp/app/home/home.component.ts | 7 +++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/app/home/home.component.html b/src/main/webapp/app/home/home.component.html index 3e623fd..be1fa45 100644 --- a/src/main/webapp/app/home/home.component.html +++ b/src/main/webapp/app/home/home.component.html @@ -135,20 +135,22 @@ >
- +
-
+
diff --git a/src/main/webapp/app/home/home.component.ts b/src/main/webapp/app/home/home.component.ts index 84a01a9..7fc732d 100644 --- a/src/main/webapp/app/home/home.component.ts +++ b/src/main/webapp/app/home/home.component.ts @@ -94,6 +94,13 @@ export class HomeComponent implements OnInit, OnDestroy { (res: HttpResponse) => { this.isLoading = false; const tmpEncuestas = res.body ?? []; + + // Fix calificacion + tmpEncuestas.forEach(encuesta => { + const _calificacion = encuesta.calificacion; + encuesta.calificacion = Number(_calificacion?.toString().split('.')[0]); + }); + this.encuestas = tmpEncuestas.filter(e => e.estado === 'ACTIVE' && e.acceso === 'PUBLIC'); this.encuestasMostradas = this.encuestas.reverse().slice(0, 3); },