Merge branch 'samandar' into 'dev'
exel name See merge request azizziy/cpost!11
This commit is contained in:
@@ -114,13 +114,13 @@ const DashboardRealBoxesPage = (props: Props) => {
|
||||
}
|
||||
};
|
||||
|
||||
const onDownloadExcel = async (id: number) => {
|
||||
const onDownloadExcel = async (id: number, name: string) => {
|
||||
if (downloadIds.includes(id)) return;
|
||||
|
||||
try {
|
||||
setDownloadIds(p => [...p, id]);
|
||||
const response = await real_box_requests.downloadExcel({ boxId: id });
|
||||
const file = new File([response.data], 'Boxses-excel.xlsx', { type: response.data.type });
|
||||
const response = await real_box_requests.downloadExcel({ boxId: id });
|
||||
const file = new File([response.data], `${name}.xlsx`, { type: response.data.type });
|
||||
file_service.download(file);
|
||||
} catch (error) {
|
||||
notifyUnknownError(error);
|
||||
@@ -325,7 +325,7 @@ const DashboardRealBoxesPage = (props: Props) => {
|
||||
icon: <Download sx={{ path: { color: '#3489E4' } }} />,
|
||||
label: t('download_excel'),
|
||||
onClick: () => {
|
||||
onDownloadExcel(data.id);
|
||||
onDownloadExcel(data.id, data.boxName);
|
||||
},
|
||||
loading: downloadIds.includes(data.id),
|
||||
dontCloseOnClick: true,
|
||||
|
||||
Reference in New Issue
Block a user