feat: rewrite component use effect
This commit is contained in:
@@ -7,7 +7,6 @@ export class Product {
|
||||
data = [];
|
||||
total_data = 0;
|
||||
filterSupplier = null;
|
||||
filterCategory = null;
|
||||
filterSubCategory = null;
|
||||
visibleModalProduct = false;
|
||||
visibleModalFilterProduct = false;
|
||||
@@ -31,7 +30,7 @@ export class Product {
|
||||
|
||||
async getData() {
|
||||
try {
|
||||
const response = await http.get(`/product/all?supplier=${this.filterSupplier}&category=${this.filterCategory}&sub-category=${this.filterSubCategory}&page=${this.page}&pageSize=${this.pageSize}`);
|
||||
const response = await http.get(`/product/all?supplier=${this.filterSupplier}&sub-category=${this.filterSubCategory}&page=${this.page}&pageSize=${this.pageSize}`);
|
||||
this.data = response.body.data.map((item, idx) => {
|
||||
item.key = idx;
|
||||
return item
|
||||
|
||||
Reference in New Issue
Block a user