Browse Source

fixed route declaration

Skylsmoi 6 years ago
parent
commit
b6b00a6680
1 changed files with 4 additions and 2 deletions
  1. 4 2
      frontend/src/container/Tracim.jsx

+ 4 - 2
frontend/src/container/Tracim.jsx View File

97
 
97
 
98
                   <Route exact path={PAGE.WORKSPACE.ROOT} render={() => props.workspaceList.length === 0 // handle '/' and redirect to first workspace
98
                   <Route exact path={PAGE.WORKSPACE.ROOT} render={() => props.workspaceList.length === 0 // handle '/' and redirect to first workspace
99
                     ? null
99
                     ? null
100
-
101
-          <PrivateRoute path='/admin_temp/workspace' component={AdminWorkspacePage} />
100
+                    : <Redirect to={{pathname: `/workspaces/${props.workspaceList[0].id}/contents`, state: {from: props.location}}} />
101
+                  } />
102
 
102
 
103
                   <Route exact path={`${PAGE.WORKSPACE.ROOT}/:idws`} render={props2 => // handle '/workspaces/:id' and add '/contents'
103
                   <Route exact path={`${PAGE.WORKSPACE.ROOT}/:idws`} render={props2 => // handle '/workspaces/:id' and add '/contents'
104
                     <Redirect to={{pathname: `/workspaces/${props2.match.params.idws}/contents`, state: {from: props.location}}} />
104
                     <Redirect to={{pathname: `/workspaces/${props2.match.params.idws}/contents`, state: {from: props.location}}} />
118
               <Redirect to={{pathname: '/login', state: {from: props.location}}} />
118
               <Redirect to={{pathname: '/login', state: {from: props.location}}} />
119
           }
119
           }
120
 
120
 
121
+          <Route path='/admin_temp/workspace' component={AdminWorkspacePage} />
122
+
121
           <Route path={'/wip/:cp'} component={WIPcomponent} /> {/* for testing purpose only */}
123
           <Route path={'/wip/:cp'} component={WIPcomponent} /> {/* for testing purpose only */}
122
 
124
 
123
           <div id='appFeatureContainer' />
125
           <div id='appFeatureContainer' />