mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] router: allow query string in paths
This commit is contained in:
committed by
Géry Debongnie
parent
a1552117f9
commit
f0b75b6890
@@ -125,7 +125,10 @@ export class Router {
|
||||
const initialParams = this.currentParams;
|
||||
const result = await this.matchAndApplyRules(path);
|
||||
if (result.type === "match") {
|
||||
const finalPath = this.routeToPath(result.route, result.params);
|
||||
let finalPath = this.routeToPath(result.route, result.params);
|
||||
if (path.indexOf("?") > -1) {
|
||||
finalPath += "?" + path.split("?")[1];
|
||||
}
|
||||
const isPopStateEvent = ev && ev instanceof PopStateEvent;
|
||||
if (!isPopStateEvent) {
|
||||
this.setUrlFromPath(finalPath);
|
||||
@@ -239,6 +242,9 @@ export class Router {
|
||||
if (route.path === "*") {
|
||||
return {};
|
||||
}
|
||||
if (path.indexOf("?") > -1) {
|
||||
path = path.split("?")[0];
|
||||
}
|
||||
if (path.startsWith("#")) {
|
||||
path = path.slice(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user