From 5e5e9b839a2e8c112b17993474febe7b0845acb8 Mon Sep 17 00:00:00 2001 From: Hazem Krimi Date: Mon, 14 Jun 2021 02:25:34 +0100 Subject: [PATCH] Fix routing bug --- src/pages/Category/index.tsx | 4 +++- src/pages/Feature/index.tsx | 4 +++- src/pages/Template/index.tsx | 10 ++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/pages/Category/index.tsx b/src/pages/Category/index.tsx index 9e30e19..e4ad962 100644 --- a/src/pages/Category/index.tsx +++ b/src/pages/Category/index.tsx @@ -76,7 +76,9 @@ const Category = () => { variant='primary-action' text='Settings' iconLeft={} - onClick={() => history.push(`/category-settings/${id}`)} + onClick={() => + history.push(`/category-settings/${id || category.id}`) + } /> diff --git a/src/pages/Feature/index.tsx b/src/pages/Feature/index.tsx index 9a2a30b..a13e93d 100644 --- a/src/pages/Feature/index.tsx +++ b/src/pages/Feature/index.tsx @@ -81,7 +81,9 @@ const Feature = () => { variant='primary-action' text='Settings' iconLeft={} - onClick={() => history.push(`/feature-settings/${id}`)} + onClick={() => + history.push(`/feature-settings/${id || feature.id}`) + } /> diff --git a/src/pages/Template/index.tsx b/src/pages/Template/index.tsx index a63bf36..5b5a7a4 100644 --- a/src/pages/Template/index.tsx +++ b/src/pages/Template/index.tsx @@ -141,7 +141,9 @@ const Template = () => { text='Prototype' iconLeft={} disabled={!prototype && role === 'productOwner'} - onClick={() => history.push(`/prototype/${id}`)} + onClick={() => + history.push(`/prototype/${id || template.id}`) + } /> {role === 'productOwner' && ( @@ -151,7 +153,11 @@ const Template = () => { variant='primary-action' text='Settings' iconLeft={} - onClick={() => history.push(`/template-settings/${id}`)} + onClick={() => + history.push( + `/template-settings/${id || template.id}` + ) + } /> )}