tambah loading export

This commit is contained in:
2024-01-17 14:49:46 +07:00
parent c140a3bbe2
commit df0ebe5c82
3 changed files with 13 additions and 5 deletions

View File

@@ -194,7 +194,7 @@ export default function List() {
const handleExportReport = async () => {
var filter = Object.fromEntries([...searchParams.entries()]);
setIsLoading(true)
await axios
.get(corporateValue + '/claims/exportAlrmCenter/'+(startDateValue ? startDateValue : 'all')+'/'+(endDateValue ? endDateValue : 'all'), { params: filter })
.then((res) => {
@@ -202,6 +202,7 @@ export default function List() {
variant: 'success',
anchorOrigin: { horizontal: 'right', vertical: 'top' },
});
setIsLoading(false)
document.location.href = res.data.data.file_url;
})
@@ -210,6 +211,7 @@ export default function List() {
variant: 'error',
anchorOrigin: { horizontal: 'right', vertical: 'top' },
})
);
};
const exportReport = {
@@ -332,6 +334,7 @@ export default function List() {
filterStartDate={filterStartDate}
filterEndDate={filterEndDate}
exportReport={exportReport}
exportLoading={isLoading}
/>
</Stack>
);