From a04197cceba12eebbb4ef5a67a7a5c1957d7805d Mon Sep 17 00:00:00 2001 From: Thomas Cardon Date: Thu, 3 Mar 2022 16:35:44 +0100 Subject: [PATCH] toggle like coeur=ok --- src/app/card-resto/card-resto.component.ts | 4 ++-- src/app/pages/resto-page/resto-page.component.ts | 3 +-- src/app/services/api-back.service.ts | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/card-resto/card-resto.component.ts b/src/app/card-resto/card-resto.component.ts index 974c93b..59750a4 100644 --- a/src/app/card-resto/card-resto.component.ts +++ b/src/app/card-resto/card-resto.component.ts @@ -35,8 +35,8 @@ export class CardRestoComponent implements OnInit { } onClickLike() { console.log('click'); - //this.isLiked = !this.isLiked; - this.clickLike.emit(this.isLiked); + this.restaurant.restauLike = !this.restaurant.restauLike; + this.clickLike.emit(this.restaurant.restauLike); } } diff --git a/src/app/pages/resto-page/resto-page.component.ts b/src/app/pages/resto-page/resto-page.component.ts index caf6e22..3b3f7d2 100644 --- a/src/app/pages/resto-page/resto-page.component.ts +++ b/src/app/pages/resto-page/resto-page.component.ts @@ -45,10 +45,9 @@ export class RestoPageComponent implements OnInit { } onEventLike(){ - this.apiBackService.restoLiked$.next(''); + this.apiBackService.restoLiked$.next(true); console.log(this.apiBackService.restoLiked$); - } diff --git a/src/app/services/api-back.service.ts b/src/app/services/api-back.service.ts index f8b0f1b..9f26101 100644 --- a/src/app/services/api-back.service.ts +++ b/src/app/services/api-back.service.ts @@ -71,4 +71,5 @@ export class ApiBackService { getPersonneById(id: any) { return this.httpClient.get(`${environment.apiUrl}/user/${id}`); } + }