Skip to content

Commit

Permalink
fix: ensure highlights routes appear when learner credit is available (
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstankiewicz authored Sep 28, 2023
1 parent 1d57072 commit 9cc4dad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
7 changes: 4 additions & 3 deletions src/components/EnterpriseApp/EnterpriseAppRoutes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ const EnterpriseAppRoutes = ({
/>

{canManageLearnerCredit && (
<LearnerCreditManagementRoutes
baseUrl={baseUrl}
<Route
path={`${baseUrl}/admin/${ROUTE_NAMES.learnerCredit}`}
component={LearnerCreditManagementRoutes}
/>
)}

Expand All @@ -110,7 +111,7 @@ const EnterpriseAppRoutes = ({
/>
)}

<Route path="" component={NotFoundPage} />
<Route path="*" component={NotFoundPage} />
</Switch>
);
};
Expand Down
11 changes: 6 additions & 5 deletions src/components/learner-credit-management/index.jsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
import React from 'react';
import { Route } from 'react-router-dom';
import PropTypes from 'prop-types';
import { ROUTE_NAMES } from '../EnterpriseApp/data/constants';
import MultipleBudgetsPage from './MultipleBudgetsPage';
import BudgetDetailPage from './BudgetDetailPage';

const LearnerCreditManagementRoutes = ({ baseUrl }) => (
const LearnerCreditManagementRoutes = ({ match }) => (
<>
<Route
exact
path={`${baseUrl}/admin/${ROUTE_NAMES.learnerCredit}`}
path={match.path}
component={MultipleBudgetsPage}
/>

<Route
exact
path={`${baseUrl}/admin/${ROUTE_NAMES.learnerCredit}/:budgetId`}
path={`${match.path}/:budgetId`}
component={BudgetDetailPage}
/>
</>
);

LearnerCreditManagementRoutes.propTypes = {
baseUrl: PropTypes.string.isRequired,
match: PropTypes.shape({
path: PropTypes.string.isRequired,
}).isRequired,
};

export default LearnerCreditManagementRoutes;

0 comments on commit 9cc4dad

Please sign in to comment.