fix: list history top up
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user