diff --git a/desk/src/components/knowledge-base-v2/ArticleCard.vue b/desk/src/components/knowledge-base-v2/ArticleCard.vue index e72fba80f..3f29dff7c 100644 --- a/desk/src/components/knowledge-base-v2/ArticleCard.vue +++ b/desk/src/components/knowledge-base-v2/ArticleCard.vue @@ -56,8 +56,9 @@ const articleImg = computed( ); function handleArticleClick() { - const category = router.currentRoute.value.query.category as string; - const subCategory = props.article.category; + const routerCategory = router.currentRoute.value.query.category as string; + const category = routerCategory || props.article.category; + const subCategory = !routerCategory ? props.article.category : ""; const articleId = props.article.name; const articleData = { diff --git a/desk/src/router/index.ts b/desk/src/router/index.ts index 703d7554e..bd43f515c 100644 --- a/desk/src/router/index.ts +++ b/desk/src/router/index.ts @@ -102,6 +102,13 @@ const routes = [ component: () => import("@/pages/knowledge-base-v2/KnowledgeBasePublic.vue"), }, + { + path: "articles/:articleId?", + name: "KBArticlePublicNew", + component: () => + import("@/pages/knowledge-base-v2/KnowledgeBaseArticle.vue"), + props: true, + }, ], }, ], @@ -217,7 +224,7 @@ const routes = [ component: () => import("@/pages/onboarding/SimpleOnboarding.vue"), }, { - path: "/:invalidpath", + path: "/:pathMatch(.*)*", name: "Invalid Page", component: () => import("@/pages/InvalidPage.vue"), },