Handling Error
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user