Redesign productDetail dialog

This commit is contained in:
2024-09-20 15:08:17 +02:00
parent 88c43d62c6
commit 871f8cac7a
18 changed files with 230 additions and 174 deletions

View File

@@ -7,5 +7,5 @@ export class ProductModel {
price: number = 0
discount: number = 0
rating: number = 1
imageUrl: string = ""
images: Array<string> = [""]
}

View File

@@ -5,9 +5,9 @@ export class ProductWithCategoryModel {
brand: string
name: string
description: string = ""
category: CategoryModel
category: CategoryModel = new CategoryModel()
price: number = 0
discount: number = 0
rating: number = 1
imageUrl: string = ""
images: Array<string> = [""]
}

View File

@@ -25,7 +25,7 @@ export const useProductStore = defineStore("productStore", {
},
async filterProducts() {
if (this.filteredCategory.id == -1) {
if (this.filteredCategory.id == -1 || this.filteredCategory.id == 0) {
this.filteredProducts = this.products
} else {
this.filteredProducts = this.products.filter((product: ProductWithCategoryModel) =>