From 5d5fa12fce816a91ecc1b24e25865a9edc3580a7 Mon Sep 17 00:00:00 2001 From: caturbgs Date: Thu, 16 Dec 2021 21:40:20 +0700 Subject: [PATCH] feat: remodel product page --- src/store/product.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/store/product.js b/src/store/product.js index 39cc536..2c377a3 100644 --- a/src/store/product.js +++ b/src/store/product.js @@ -49,14 +49,7 @@ export class Product { async getDataCategories() { const response = await http.get(`/product/categories?page=${this.pageCategories}&pageSize=${this.pageSizeCategories}`); - this.dataCategories = response.body.data ?? [] - this.total_dataCategories = response.body.total_data ?? 0 - - if (this.dataCategories.length > 0) { - this.filterCategory = this.dataCategories[0].id - } - - this.dataCategories = this.dataCategories.map((item, idx) => { + this.dataCategories = response.body.data.map((item, idx) => { item.key = idx; return item }) ?? []