Ver Fonte

🐛 fix data parsing

jmacura há 4 anos atrás
pai
commit
0c2f81a361
1 ficheiros alterados com 3 adições e 2 exclusões
  1. 3 2
      src/adjuster/adjuster.service.ts

+ 3 - 2
src/adjuster/adjuster.service.ts

@@ -9,6 +9,7 @@ import nuts from '../nuts';
 @Injectable({providedIn: 'root'})
 export class AdjusterService {
   nutsCodeRecordRelations = {};
+  attractivity;
   factors: any = [
     {
       name: 'Natural',
@@ -81,8 +82,8 @@ export class AdjusterService {
             }),
           })
           .toPromise()
-          .then((response: any) => {
-            this.attractivity = response.data;
+          .then((data: any) => {
+            this.attractivity = data;
             let max = 0;
             this.attractivity.forEach((a) => {
               if (a.aggregate > max) {