Files
dancefinder-app/plugins/graph-routing.js
T
2019-01-15 13:21:24 +01:00

16 lines
372 B
JavaScript

export default ({ app }) => {
app.router.beforeEach((to, from, next) => {
// keep the graphql api url variable on all navigation,
// if it is actually present.
let target;
if (!to.query.graph && from.query.graph) {
target = {
path: to.path,
query: { ...to.query, graph: from.query.graph },
};
}
next(target);
});
}