Skip to content

Commit

Permalink
fix: null error at useRouteMatch when running on tutor
Browse files Browse the repository at this point in the history
tutor sets the PUBLIC_PATH to '/discussions' which causes frontend-platform to
treat all URLs for matching etc to be relative to this path. Since many places
include '/discussions' in the match it causes those matches to break.

This change makes the default PUBLIC_PATH in .env.development to match the one
set by tutor and removes it from the base path of the router letting frontend
platform handle the prefix.

This also allows for deployments to customise this path to be something other
then 'discussions'.
  • Loading branch information
xitij2000 committed Nov 29, 2023
1 parent a479f5a commit 8fcefa4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ USER_INFO_COOKIE_NAME='edx-user-info'
SUPPORT_URL='https://support.edx.org'
LEARNER_FEEDBACK_URL=''
STAFF_FEEDBACK_URL=''
PUBLIC_PATH='/discussions'
2 changes: 1 addition & 1 deletion src/data/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export const DiscussionProvider = {
OPEN_EDX: 'openedx',
};

const BASE_PATH = `${getConfig().PUBLIC_PATH}:courseId`;
const BASE_PATH = '/:courseId';

export const Routes = {
DISCUSSIONS: {
Expand Down

0 comments on commit 8fcefa4

Please sign in to comment.