feat: fix paging data
This commit is contained in:
@@ -23,10 +23,10 @@ export class Category {
|
||||
try {
|
||||
const response = await http.get(`/product/categories?page=${this.page}&pageSize=${this.pageSize}`);
|
||||
this.data = response.body.data.map((item, idx) => {
|
||||
item.key = idx;
|
||||
return item
|
||||
}) ?? []
|
||||
this.total_data = response.body.total_data ?? 0
|
||||
item.key = idx;
|
||||
return item
|
||||
}) ?? []
|
||||
this.total_data = response?.body?.count ?? 0
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
@@ -55,7 +55,7 @@ export class Category {
|
||||
return item
|
||||
}) ?? []
|
||||
|
||||
this.total_dataCategories = response.body.total_data ?? 0
|
||||
this.total_dataCategories = response?.body?.count ?? 0
|
||||
if (this.dataCategories.length > 0) {
|
||||
this.filterCategory = this.dataCategories[0].id
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user