From 234fda43491d36816a055f7fda3e00cfe573cf45 Mon Sep 17 00:00:00 2001 From: Benoit Alessandroni <benoit@happy-dev.fr> Date: Thu, 2 Apr 2020 14:27:22 +0200 Subject: [PATCH] Fixing the user retrieval --- src/includes/entrepreneur/resources/detail.pug | 2 +- src/scripts/dispatch-space-n-user.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/includes/entrepreneur/resources/detail.pug b/src/includes/entrepreneur/resources/detail.pug index 3efe7304..909cb8f8 100644 --- a/src/includes/entrepreneur/resources/detail.pug +++ b/src/includes/entrepreneur/resources/detail.pug @@ -1,5 +1,5 @@ .block_log.block_creat_count.no_shadow - sib-link(class="backlink", next="entrepreneur-resource-list") + sib-link(class="backlink", next="entrepreneur-dashboard") .like p.backlink i.fas.fa-times diff --git a/src/scripts/dispatch-space-n-user.js b/src/scripts/dispatch-space-n-user.js index a438122f..e56c474e 100644 --- a/src/scripts/dispatch-space-n-user.js +++ b/src/scripts/dispatch-space-n-user.js @@ -78,12 +78,13 @@ class CoopStarterLoginComponent extends HTMLElement { //If the url is different after the treatment, we reload with the good url if(newUrl !== window.location.href){ - var newRoute = new URL(newUrl).pathname.replace(/^\/([a-z]{2})\//, "") - + console.log(newUrl); + var newRoute = new URL(newUrl).pathname.replace(/^\/([a-z]{2})\//, ""); + console.log(newRoute.split(/\/(.*?)\//)[1]); window.dispatchEvent( new CustomEvent('requestNavigation', { detail: { - route: 'entrepreneur-resource-detail', + route: newRoute.split(/\/(.*?)\//)[1], resource: { "@id": this.decodeId(newRoute.split(/@(.+)/)[1]) } } }) -- GitLab