Handling Error

This commit is contained in:
2021-12-22 19:27:25 +07:00
parent 7928df9fc6
commit a115d8488b
4 changed files with 52 additions and 20 deletions

View File

@@ -22,10 +22,14 @@ export class Transaction {
filterSubCategory = null;
pageHistoryTransaction = 0;
pageHistoryTopUp = 0;
// pageSizeHistoryTransaction = 10
dataHistoryTransaction = [];
total_dataHistoryTransaction = 0;
dataHistoryTopUp=[];
total_dataHistoryTopUp = 0;
constructor(ctx) {
this.ctx = ctx;
makeAutoObservable(this);
@@ -76,6 +80,18 @@ export class Transaction {
}
}
async getDataHistoryTopUp(id) {
try {
console.log("Top up")
const response = await http.get(`/transaction/history-deposit?page=${this.pageHistoryTopUp}&user-destination=${id}`);
this.dataHistoryTopUp = response.body.data ?? []
this.total_dataHistoryTopUp = response?.body?.count ?? 0
} catch (e) {
console.error(e);
}
}
async create(data) {
try {
const response = await http.post('/product').send(data);