Skip to content

Commit

Permalink
fix: add routing for article page in customer portal
Browse files Browse the repository at this point in the history
  • Loading branch information
RitvikSardana committed Oct 2, 2024
1 parent 8b3a1c4 commit b6dff21
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions desk/src/components/knowledge-base-v2/ArticleCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
9 changes: 8 additions & 1 deletion desk/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
],
},
],
Expand Down Expand Up @@ -217,7 +224,7 @@ const routes = [
component: () => import("@/pages/onboarding/SimpleOnboarding.vue"),
},
{
path: "/:invalidpath",
path: "/:pathMatch(.*)*",
name: "Invalid Page",
component: () => import("@/pages/InvalidPage.vue"),
},
Expand Down

0 comments on commit b6dff21

Please sign in to comment.