From 66f9ed5317159d2827313185479a222aab316aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Mon, 29 Jan 2024 19:39:12 +0100 Subject: [PATCH] fix: remove categories_associate filters when removing categories filter --- webapp-next/components/layouts/FiltersShortcut.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/webapp-next/components/layouts/FiltersShortcut.tsx b/webapp-next/components/layouts/FiltersShortcut.tsx index e2bd799..d8f4b47 100644 --- a/webapp-next/components/layouts/FiltersShortcut.tsx +++ b/webapp-next/components/layouts/FiltersShortcut.tsx @@ -113,6 +113,20 @@ export function FiltersShortcut() { /> )); case 'categories': + return filters[key].map(value => ( + { + setFilters({ + ...filters, + [key]: filters[key].filter(v => v !== value), + categories_associate: [] + }); + }} + /> + )); case 'categories_associate': case 'death_location': case 'sex':