From ad1f12393cb8129367e27de6f2a860f14a02ffa8 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 8 Nov 2021 18:59:10 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Display=20not=20found=20errors?= =?UTF-8?q?=20for=20not=20available=20resource=20keys?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/routing/ViewSetRouter.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/routing/ViewSetRouter.tsx b/frontend/src/components/routing/ViewSetRouter.tsx index d6cf085..4f31963 100644 --- a/frontend/src/components/routing/ViewSetRouter.tsx +++ b/frontend/src/components/routing/ViewSetRouter.tsx @@ -50,7 +50,15 @@ export function ViewSetRouter({viewSet, unselec ) } - const selection = pk ? viewSet.resources?.find(res => res.value[pkKey] === pk) : undefined + let selection + if(pk) { + selection = viewSet.resources?.find(res => res.value[pkKey] === pk) + if(!selection) { + return ( + + ) + } + } return (