mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
incr: remove details from the route info
This commit is contained in:
parent
f6219f956c
commit
bbde25f392
@ -116,8 +116,25 @@ const routes = [
|
||||
|
||||
let router = createRouter({ routes, history: createWebHistory() });
|
||||
|
||||
router.afterEach((to, from, failure) => {
|
||||
const more = { from: from.fullPath, to: to.fullPath };
|
||||
function removeDetails(path) {
|
||||
if (!path) {
|
||||
return path;
|
||||
}
|
||||
|
||||
const match = path.match(/edit=1/);
|
||||
if (!match) {
|
||||
return path;
|
||||
}
|
||||
|
||||
return path.slice(0, match.index + 4);
|
||||
}
|
||||
|
||||
router.afterEach((to, from) => {
|
||||
const more = {
|
||||
from: removeDetails(from.fullPath),
|
||||
to: removeDetails(to.fullPath),
|
||||
};
|
||||
|
||||
telemetry.log(Verb.Navigated, NounEnum.Route, more);
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user