diff --git a/frontend/src/router/index.tsx b/frontend/src/router/index.tsx index 8aa87b6..1a3a054 100644 --- a/frontend/src/router/index.tsx +++ b/frontend/src/router/index.tsx @@ -13,8 +13,9 @@ import { Navigate } from 'react-router-dom'; export const webPath = { home: () => '/', browse: () => '/browse', - workspace: () => '/workspace', - admin: (id: string) => `/admin/${id}`, + workspace: (workspaceId: string, projectId?: string) => + projectId ? `/workspace/${workspaceId}/project/${projectId}` : `/workspace/${workspaceId}`, + admin: (workspaceId: string) => `/admin/${workspaceId}`, oauthCallback: () => '/redirect/oauth2', }; @@ -44,17 +45,21 @@ const router = createBrowserRouter([ ], }, { - path: webPath.workspace(), + path: '/workspace/:workspaceId', element: , children: [ { - index: true, + path: '', element:
workspace
, }, + { + path: 'project/:projectId', + element:
workspace project
, + }, ], }, { - path: webPath.admin(':id'), + path: webPath.admin(':workspaceId'), element: , children: [ {