Make trailing slash optional

This commit is contained in:
Jordan Eldredge 2020-11-29 22:54:21 -08:00
parent 9d8c9afc09
commit 4fe17d95c5

View file

@ -27,14 +27,16 @@ const urlChangedEpic = (actions) =>
actions.pipe(
filter((action) => action.type === "URL_CHANGED"),
switchMap((action) => {
if (action.location.pathname === "/about/") {
return of(Actions.requestedAboutPage());
}
if (action.location.pathname === "/upload/") {
return of(Actions.requestedUploadPage());
}
if (action.location.pathname === "/review/") {
return of(Actions.requestedReviewPage());
const pathname = action.location.pathname.replace("/$", "");
switch (pathname) {
case "/about":
return of(Actions.requestedAboutPage());
case "/upload":
return of(Actions.requestedUploadPage());
case "/review":
return of(Actions.requestedReviewPage());
default:
//
}
const params = new URLSearchParams(action.location.search);
const query = params != null && params.get("query");