Pārlūkot izejas kodu

deleted duplicates

rjsmall90 6 gadus atpakaļ
vecāks
revīzija
0748542bea
1 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  1. 5
    1
      src/providers/connection/district.ts

+ 5
- 1
src/providers/connection/district.ts Parādīt failu

@@ -24,7 +24,11 @@ export class DistrictProvider {
24 24
     }
25 25
 
26 26
     parseData(data: any) {
27
-        return data["data"].map(school => new School(school[13]))
27
+        return data["data"].map(school => school[13]).filter(this.onlyUnique).map(school => new School(school));
28
+    }
29
+
30
+    onlyUnique(value, index, self) { 
31
+        return self.indexOf(value) === index;
28 32
     }
29 33
 
30 34