trithuc-mvc-react 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,25 +3,25 @@ import { exportExcel } from "../../api";
3
3
  import { Button } from "@mui/material";
4
4
  import { Download } from "@mui/icons-material";
5
5
 
6
- const ExportExcelButton = ({ tableName })=>{
7
- const handleExportExcel = async (tableName) => {
8
- const data = await exportExcel({ tableName });
9
- if (data.status) {
10
- window.open(data.url, "_blank").focus();
11
- } else {
12
- toast.error("Xuất file thất bại!");
13
- }
14
- };
15
- return (
16
- <Button
17
- variant="outlined"
18
- startIcon={<Download />}
19
- onClick={() => {
20
- handleExportExcel(tableName);
21
- }}
22
- >
23
- Excel
24
- </Button>
25
- );
6
+ const ExportExcelButton = ({ tableName, data }) => {
7
+ const handleExportExcel = async (tableName, data) => {
8
+ const _data = await exportExcel({ tableName, data });
9
+ if (_data.status) {
10
+ window.open(_data.url, "_blank").focus();
11
+ } else {
12
+ toast.error("Xuất file thất bại!");
13
+ }
14
+ };
15
+ return (
16
+ <Button
17
+ variant="outlined"
18
+ startIcon={<Download />}
19
+ onClick={() => {
20
+ handleExportExcel(tableName);
21
+ }}
22
+ >
23
+ Excel
24
+ </Button>
25
+ );
26
26
  }
27
27
  export default ExportExcelButton;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trithuc-mvc-react",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"