fix: list history top up

This commit is contained in:
2022-12-31 05:00:48 +07:00
parent c957483666
commit 08196fdc1d
3 changed files with 75 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
import { makeAutoObservable } from "mobx";
import { http } from "../utils/http";
import { binaryStringToArrayBuffer, arrayBufferToBlob } from 'blob-util'
export class Transaction {
page = 0;
@@ -267,4 +268,21 @@ export class Transaction {
console.error(e);
}
}
async exportTransaction(id,data) {
try {
const response = await http
.post(`/excel/history-user/export/${id}`)
.send(data)
console.log(response, 'ress');
const apa = binaryStringToArrayBuffer(response.text)
const ini = arrayBufferToBlob(apa, 'text/xlsx')
let file = new File([ini], 'text.xlsx', {type: "text/xlsx;charset=utf-8"})
console.log(file, 'ini file');
return file;
} catch (e) {
console.error(e);
}
}
}