Skip to content

Commit

Permalink
remove console and unused dummy stmt
Browse files Browse the repository at this point in the history
  • Loading branch information
payal-canyon committed Dec 17, 2024
1 parent b0b89a0 commit 3329580
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function show(KnowledgeBaseCategory $category): JsonResponse
'description' => $category->description,
'parent_id' => $category->parent_id,
]),
'parentCategory' => $category?->parentCategory,
'parentCategory' => $category->parentCategory,
'subCategories' => $category
->subCategories()
->get()
Expand Down
29 changes: 12 additions & 17 deletions portals/knowledge-management/src/Pages/ViewCategory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
const toArticle = ref(0);
const filter = ref('');
const fromSearch = ref(false);
const parentCategory = ref({});
const parentCategory = ref(null);

const debounceSearch = debounce((value, page = 1) => {
const { post } = consumer();
Expand Down Expand Up @@ -179,22 +179,15 @@
debounceSearch(searchQuery.value);
};

if(parentCategory.value){
console.log('xx');
}


// const breadcrumbs = computed(() => {
// if (parentCategory.value) {
// return [
// { name: parentCategory.name, route: 'view-subcategory', params: { subCategorySlug: parentCategory.slug } },
// ];
// }

// return [{name :'Ankit', slug:'default'}];
// });
const breadcrumbs = computed(() => {
if (parentCategory.value) {
return [
{ name: parentCategory.value.name, route: 'view-category', params: { categorySlug: parentCategory.value.slug } },
];
}

// console.log('bred',breadcrumbs);
return [];
});

watch(
route,
Expand All @@ -209,15 +202,17 @@
);

async function getData(page = 1) {

if (fromSearch.value) {
debounceSearch(searchQuery.value, page);
return;
}

loadingResults.value = true;

const { get } = consumer();
const slug = route.params.categorySlug ?? route.params.subCategorySlug;

await get(props.apiUrl + '/categories/' + slug, { page: page, filter: filter.value }).then(
(response) => {
if (response.data.category.slug !== slug) {
Expand Down

0 comments on commit 3329580

Please sign in to comment.