Skip to content

Commit

Permalink
Merge pull request #1952 from RitvikSardana/article-error
Browse files Browse the repository at this point in the history
fix: get article category and sub category from query params
  • Loading branch information
RitvikSardana authored Aug 30, 2024
2 parents 0cb6244 + bf14184 commit e8e7473
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
16 changes: 7 additions & 9 deletions desk/src/pages/KnowledgeBaseArticle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,15 @@ const router = useRouter();
const authStore = useAuthStore();
const isNew = props.articleId === "new";
const editMode = ref(isNew);
const categoryId = computed(
() => article.data?.category.name || route.query.category
);
const subCategoryId = computed(
() => article.data?.sub_category.name || route.query.subCategory
);
const categoryId = computed(() => route.query.category);
const subCategoryId = computed(() => route.query.subCategory);
const breadcrumbs = computed(() => {
const items = [
{
label: options__.value.categoryName,
route: {
name: AGENT_PORTAL_KNOWLEDGE_BASE_CATEGORY,
params: {
categoryId: options__.value.categoryId,
},
params: { categoryId: options__.value.categoryId },
},
},
{
Expand All @@ -159,6 +153,10 @@ const breadcrumbs = computed(() => {
params: {
articleId: article.data?.name,
},
query: {
category: options__.value.categoryId,
subCategory: options__.value.subCategoryId,
},
},
});
}
Expand Down
4 changes: 4 additions & 0 deletions desk/src/pages/knowledge-base/KnowledgeBaseSubcategory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ const articles = createListManager({
params: {
articleId: d.name,
},
query: {
category: route.params.categoryId,
subCategory: route.params.subCategoryId,
},
};
}
return data;
Expand Down

0 comments on commit e8e7473

Please sign in to comment.