Fix routing bug

This commit is contained in:
Hazem Krimi
2021-06-14 02:25:34 +01:00
parent 2e767da17d
commit 5e5e9b839a
3 changed files with 14 additions and 4 deletions
+3 -1
View File
@@ -76,7 +76,9 @@ const Category = () => {
variant='primary-action' variant='primary-action'
text='Settings' text='Settings'
iconLeft={<Settings />} iconLeft={<Settings />}
onClick={() => history.push(`/category-settings/${id}`)} onClick={() =>
history.push(`/category-settings/${id || category.id}`)
}
/> />
</Box> </Box>
<Box> <Box>
+3 -1
View File
@@ -81,7 +81,9 @@ const Feature = () => {
variant='primary-action' variant='primary-action'
text='Settings' text='Settings'
iconLeft={<Settings />} iconLeft={<Settings />}
onClick={() => history.push(`/feature-settings/${id}`)} onClick={() =>
history.push(`/feature-settings/${id || feature.id}`)
}
/> />
</Box> </Box>
<Box marginBottom='30px'> <Box marginBottom='30px'>
+8 -2
View File
@@ -141,7 +141,9 @@ const Template = () => {
text='Prototype' text='Prototype'
iconLeft={<Design />} iconLeft={<Design />}
disabled={!prototype && role === 'productOwner'} disabled={!prototype && role === 'productOwner'}
onClick={() => history.push(`/prototype/${id}`)} onClick={() =>
history.push(`/prototype/${id || template.id}`)
}
/> />
</Box> </Box>
{role === 'productOwner' && ( {role === 'productOwner' && (
@@ -151,7 +153,11 @@ const Template = () => {
variant='primary-action' variant='primary-action'
text='Settings' text='Settings'
iconLeft={<Settings />} iconLeft={<Settings />}
onClick={() => history.push(`/template-settings/${id}`)} onClick={() =>
history.push(
`/template-settings/${id || template.id}`
)
}
/> />
</Box> </Box>
)} )}