diff --git a/src/app/structure-list/components/card/card.component.ts b/src/app/structure-list/components/card/card.component.ts index 5d2d7dd66fe0eb2dbe425cde4abf40b12f37de20..8a1b657e1851ff7c44558373391bea4b6ee73ee9 100644 --- a/src/app/structure-list/components/card/card.component.ts +++ b/src/app/structure-list/components/card/card.component.ts @@ -45,11 +45,17 @@ export class CardComponent implements OnInit { public cardClicked(): void { this.showDetails.emit(this.structure); + const queryString = this.route.snapshot.queryParamMap.get('search'); this.router.navigate([], { relativeTo: this.route, - queryParams: { - id: this.structure._id, - }, + queryParams: queryString + ? { + id: this.structure._id, + search: queryString, + } + : { + id: this.structure._id, + }, }); } diff --git a/src/app/structure-list/structure-list.component.html b/src/app/structure-list/structure-list.component.html index 951c2726ab0b736b89d2a13bba450c674e46b033..1b39ec645a918b527da515ed058348472ef6b30f 100644 --- a/src/app/structure-list/structure-list.component.html +++ b/src/app/structure-list/structure-list.component.html @@ -16,7 +16,7 @@ <app-card *ngFor="let structure of structuresListChunked" [structure]="structure" - (showDetails)="showDetails($event)" + (showDetails)="showDetails($event, filters)" (hover)="handleCardHover($event)" ></app-card> <p *ngIf="structureList && structureList.length <= 0">Il n'y a aucune réponse correspondant à votre recherche</p>