feat: adjust flow to display transaction

This commit is contained in:
caturbgs
2021-12-16 23:22:50 +07:00
parent c1513c9e78
commit b8c407bf11
4 changed files with 143 additions and 176 deletions

View File

@@ -6,7 +6,7 @@ export class Transaction {
pageSize = 10
data = [];
total_data = 0;
filterCategory = null;
filterSubCategory = null;
visibleModalProduct = false;
pageCategories = 0;
@@ -18,6 +18,7 @@ export class Transaction {
pageSizeSubCategories = 10
dataSubCategories = [];
total_dataSubCategories = 0;
filterSubCategory = null;
pageHistoryTransaction = 0;
// pageSizeHistoryTransaction = 10
@@ -31,7 +32,7 @@ export class Transaction {
async getData() {
try {
const response = await http.get(`/product/by-categories?categories=${this.filterCategory}&page=${this.page}&pageSize=${this.pageSize}`);
const response = await http.get(`/product/by-categories-all?subCategories=${this.filterSubCategory}&page=${this.page}&pageSize=${this.pageSize}`);
this.data = response.body.data ?? []
this.total_data = response.body.total_data ?? 0
} catch (e) {
@@ -41,7 +42,7 @@ export class Transaction {
async getDataSubCategories() {
try {
const response = await http.get(`/product/sub-categories?page=${this.pageSubCategories}&pageSize=${this.pageSizeSubCategories}`);
const response = await http.get(`/product/sub-categories?categories=${this.filterCategory}&page=${this.pageSubCategories}&pageSize=${this.pageSizeSubCategories}`);
this.dataSubCategories = response.body.data ?? []
this.total_dataSubCategories = response.body.count ?? 0
} catch (e) {