Skip to content

Commit

Permalink
Fix router to accept query params preceded by '?'
Browse files Browse the repository at this point in the history
Previously these were parsed, but not accepted by the routes.
  • Loading branch information
thostetler committed Dec 4, 2020
1 parent b6cee78 commit 88a4802
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/js/apps/discovery/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ define([
},

execute: function(callback, args) {
// the routes assume the query params are the first arg, so make sure it isn't undefined
const argsToPass = args.filter((a) => a !== undefined);

if (_.isFunction(callback)) {
callback.apply(this, args);
callback.apply(this, argsToPass);
}
},

Expand Down Expand Up @@ -141,7 +143,9 @@ define([
);
}
} else {
this.getPubSub().publish(this.getPubSub().NAVIGATE, 'index-page', { replace: true });
this.getPubSub().publish(this.getPubSub().NAVIGATE, 'index-page', {
replace: true,
});
}
},

Expand Down

0 comments on commit 88a4802

Please sign in to comment.