ui: fix DashboardRouter trailing slashes
This commit is contained in:
parent
b59e1da860
commit
e88197c4b1
1 changed files with 2 additions and 2 deletions
|
@ -21,7 +21,7 @@ function DashboardRouter() {
|
||||||
{routes.account
|
{routes.account
|
||||||
.filter(route => route.path !== undefined)
|
.filter(route => route.path !== undefined)
|
||||||
.map(({ path, name, end = false }) => (
|
.map(({ path, name, end = false }) => (
|
||||||
<NavLink key={path} to={`/account/${path ?? ''}`.replace('//', '/')} end={end}>
|
<NavLink key={path} to={`/account/${path ?? ''}`.replace(/\/$/, '')} end={end}>
|
||||||
{name}
|
{name}
|
||||||
</NavLink>
|
</NavLink>
|
||||||
))}
|
))}
|
||||||
|
@ -34,7 +34,7 @@ function DashboardRouter() {
|
||||||
<Route path="" element={<DashboardContainer />} />
|
<Route path="" element={<DashboardContainer />} />
|
||||||
|
|
||||||
{routes.account.map(({ route, component: Component }) => (
|
{routes.account.map(({ route, component: Component }) => (
|
||||||
<Route key={route} path={`/account/${route}`.replace('//', '/')} element={<Component />} />
|
<Route key={route} path={`/account/${route}`.replace(/\/$/, '')} element={<Component />} />
|
||||||
))}
|
))}
|
||||||
|
|
||||||
<Route path="*" element={<NotFound />} />
|
<Route path="*" element={<NotFound />} />
|
||||||
|
|
Loading…
Reference in a new issue