From 3141cbed4d1e0b1045bd5a42cc77dab6873946a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Huchet?= Date: Mon, 4 Apr 2022 15:23:39 +0200 Subject: [PATCH] fix: up --- dashboard/src/scenes/reception/view.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dashboard/src/scenes/reception/view.js b/dashboard/src/scenes/reception/view.js index 8e9b0a405..bfc690de8 100644 --- a/dashboard/src/scenes/reception/view.js +++ b/dashboard/src/scenes/reception/view.js @@ -126,8 +126,14 @@ const Reception = () => { const onSelectPerson = (persons) => { const searchParams = new URLSearchParams(location.search); - searchParams.set('persons', persons.map((p) => p._id).join(',')); - setSelectedPersons(persons); + searchParams.set( + 'persons', + (persons || []) + .map((p) => p?._id) + .filter(Boolean) + .join(',') + ); + setSelectedPersons(persons || []); history.replace({ pathname: location.pathname, search: searchParams.toString() }); };