Skip to content

Commit

Permalink
Merge pull request #357 from appsembler/bryan/frontend-handle-slash-s…
Browse files Browse the repository at this point in the history
…ep-course-ids

SingleCourseContent route - Fix the regex for new-style course ids
  • Loading branch information
bryanlandia authored Jun 1, 2021
2 parents 1cee763 + f2c6449 commit 71bd7c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class App extends Component {
<Route exact path="/figures/learners-progress-overview" component={ProgressOverview} />
{(process.env.ENABLE_CSV_REPORTS === "enabled") && <Route exact path="/figures/csv-reports" component={CsvReports} />}
{/* course-v..-like course ids */}
<Route path="/figures/course/(?!(\/))" render={({ match }) => <SingleCourseContent courseId={match.params[0]} />}/>
<Route path={/(\/figures\/course\/)((?:(?!\/).)*$)/} render={({ match }) => <SingleCourseContent courseId={match.params[1]} />}/>
{/* old slash-separated course id style */}
<Route path="/figures/course/:courseOrg/:courseNum/:courseRun" render={({ match }) => <SingleCourseContent courseId={`${match.params.courseOrg}/${match.params.courseNum}/${match.params.courseRun}`} />}/>
<Route path="/figures/user/:userId" render={({ match }) => <SingleUserContent userId={match.params.userId} />}/>
Expand Down

0 comments on commit 71bd7c8

Please sign in to comment.