merge
This commit is contained in:
@@ -28,14 +28,12 @@ const mainCategoriesMenu = computed(() => {
|
||||
const filteredCategories = computed(() => {
|
||||
if (categories.value) {
|
||||
return categories.value
|
||||
.filter((mainCategory) => {
|
||||
if (selectedCategory.value === "همه دسته ها") return true;
|
||||
return mainCategory.name === selectedCategory.value;
|
||||
})
|
||||
.flatMap((mainCategory) => mainCategory.subcategorys)
|
||||
.filter((category) => {
|
||||
if (selectedCategory.value === "همه دسته ها") {
|
||||
return category.name.includes(debouncedSearch.value);
|
||||
}
|
||||
|
||||
return category.name.includes(debouncedSearch.value) && category.parent === selectedCategory.value;
|
||||
});
|
||||
.filter((category) => category.name.includes(debouncedSearch.value));
|
||||
}
|
||||
return [];
|
||||
});
|
||||
@@ -61,7 +59,7 @@ if (response.isError) {
|
||||
|
||||
<div class="w-full flex items-center justify-between lg:justify-end gap-4">
|
||||
<Input
|
||||
placeholder="جست و جو محصول ..."
|
||||
placeholder="جست و جو دسته بندی ..."
|
||||
v-model="search"
|
||||
variant="outlined"
|
||||
class="!rounded-xl w-full lg:w-8/12"
|
||||
|
||||
Reference in New Issue
Block a user