diff --git a/src/app/pages/favoris-user/favoris-user.component.html b/src/app/pages/favoris-user/favoris-user.component.html
index 427f2ac..aaadff3 100644
--- a/src/app/pages/favoris-user/favoris-user.component.html
+++ b/src/app/pages/favoris-user/favoris-user.component.html
@@ -1,8 +1,6 @@
-
-
+
+
diff --git a/src/app/pages/favoris-user/favoris-user.component.ts b/src/app/pages/favoris-user/favoris-user.component.ts
index 84adea7..625a625 100644
--- a/src/app/pages/favoris-user/favoris-user.component.ts
+++ b/src/app/pages/favoris-user/favoris-user.component.ts
@@ -9,24 +9,30 @@ import { TokenService } from 'src/app/services/token.service';
})
export class FavorisUserComponent implements OnInit {
- personneConnectee : any;
- constructor(private apiBackService : ApiBackService,private tokenService : TokenService) {
+ personneConnectee : any;
+ listPref: any;
+ restaurantData : any[];
+
+ constructor(private apiBackService : ApiBackService, private tokenService : TokenService) {
+
+this.restaurantData = []
}
ngOnInit(): void {
-
+
this.apiBackService.getPersonneById(this.tokenService.getCurrentUserId()).subscribe(
- resp =>{
- console.log(resp);
-
- this.personneConnectee = resp;
+ user =>{
+
+ this.listPref = user.preference;
+ console.log(this.listPref);
+
+ for (let i = 0; i < this.listPref.length; i++) {
+ this.restaurantData.push(this.listPref[i]['preferencePK']['restau']);
+ }
+
}
);
- console.log(this.personneConnectee);
-
-
}
-
-}
+}
\ No newline at end of file
diff --git a/src/app/pages/resto-page/resto-page.component.html b/src/app/pages/resto-page/resto-page.component.html
index 12adc1d..bc88160 100644
--- a/src/app/pages/resto-page/resto-page.component.html
+++ b/src/app/pages/resto-page/resto-page.component.html
@@ -1,4 +1,4 @@
-
+
diff --git a/src/app/services/api-back.service.ts b/src/app/services/api-back.service.ts
index 091ff2b..e821706 100644
--- a/src/app/services/api-back.service.ts
+++ b/src/app/services/api-back.service.ts
@@ -34,14 +34,12 @@ export class ApiBackService {
}
setListRestau(listRestau: any[], routeParam?: string): void {
-
this.restoFilter = listRestau;
this.routeParam = routeParam;
}
setDistance(lat1: number, lon1: number, lat2: number, lon2: number) {
-
let R = 6371; // Radius of the earth in km
let dLat = this.deg2rad(lat2 - lat1); // deg2rad below
let dLon = this.deg2rad(lon2 - lon1);
@@ -65,12 +63,11 @@ export class ApiBackService {
}
deleteRestau(idRestau: number | undefined): Observable {
-
return this.httpClient.delete(`${environment.apiUrl}/delete-restaurant/${idRestau}`);
}
getPersonneById(id: any) {
- return this.httpClient.get(`${environment.apiUrl}/user/${id}`);
+ return this.httpClient.get(`${environment.apiUrl}/user/${id}`);
}
-}
\ No newline at end of file
+}