Skip to content

Commit

Permalink
fix(profiles): fix routes
Browse files Browse the repository at this point in the history
  • Loading branch information
JalilArfaoui committed Jan 13, 2022
1 parent 247b696 commit cd8c75b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/app/profiles/App/Pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,31 @@ const Pages = () => {
<>
<Switch>
<Route
path={`${prefix}/${t('path.profiles.contributors')}`}
path={`${prefix}${t('path.profiles.contributors')}`}
component={Profiles}
/>
<Route
path={`${prefix}/${t('path.profiles.subscriptions')}`}
path={`${prefix}${t('path.profiles.subscriptions')}`}
component={Subscriptions}
/>
{getFacet() !== 'lmel' && (
<Redirect
exact
from={`/${t('path.profiles.contributors')}`}
to={`/${i18n.language}/${t('path.profiles.contributors')}`}
from={`${t('path.profiles.contributors')}`}
to={`/${i18n.language}${t('path.profiles.contributors')}`}
/>
)}
{getFacet() !== 'lmel' && (
<Redirect
exact
from={`/${t('path.profiles.subscriptions')}`}
to={`/${i18n.language}/${t('path.profiles.subscriptions')}`}
from={`${t('path.profiles.subscriptions')}`}
to={`/${i18n.language}${t('path.profiles.subscriptions')}`}
/>
)}
<Redirect
exact
from="/"
to={`${prefix}/${t('path.profiles.contributors')}`}
to={`${prefix}${t('path.profiles.contributors')}`}
/>
<Route render={() => <Error message="Introuvable" />} />
</Switch>
Expand Down
2 changes: 1 addition & 1 deletion src/app/profiles/store/sagas/locationChange.saga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function* contributorLocationSaga(match: Match<{ id: string }>) {
yield put(refreshContributors());
}

const prefix = getFacet() === 'lmel' ? '/' : '/:lang/';
const prefix = getFacet() === 'lmel' ? '' : '/:lang';

export default function* locationChangeSaga() {
yield takeLatestLocationChange(
Expand Down
1 change: 1 addition & 0 deletions src/app/website/server/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ router
.get(`/en${en.path.profiles.subscriptions}`, serveProfiles)
.get(`/fr${fr.path.profiles.subscriptions}`, serveProfiles)
.get(`${fr.path.profiles.contributors}/:id?/:name?`, serveProfiles)
.get(`${fr.path.profiles.contributors}`, serveProfiles)
.get(`${fr.path.profiles.subscriptions}`, serveProfiles);

0 comments on commit cd8c75b

Please sign in to comment.