From c0416f3b461457fb9a93050399b3c1acda65f695 Mon Sep 17 00:00:00 2001 From: MariusGrunenberg <43036408+MariusGrunenberg@users.noreply.github.com> Date: Wed, 5 Dec 2018 09:28:54 +0100 Subject: [PATCH] Search - encode search queries (#852) * Added Encoding to search queries. Slashes now won't cause any troubles with routing. * Changed Encoding to remain original value * fix prettier formatting --- src/app/store/effects/search.effects.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/store/effects/search.effects.ts b/src/app/store/effects/search.effects.ts index 01447cb82..2f5cc3673 100644 --- a/src/app/store/effects/search.effects.ts +++ b/src/app/store/effects/search.effects.ts @@ -42,11 +42,14 @@ export class SearchEffects { item => item.id === SearchOptionIds.Libraries ); const librarySelected = !!libItem && libItem.value; - if (librarySelected) { - this.router.navigateByUrl('/search-libraries;q=' + action.payload); + this.router.navigateByUrl( + '/search-libraries;q=' + encodeURIComponent(action.payload) + ); } else { - this.router.navigateByUrl('/search;q=' + action.payload); + this.router.navigateByUrl( + '/search;q=' + encodeURIComponent(action.payload) + ); } }) );