@visns-studio/visns-components 5.7.17 → 5.7.18

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.
package/package.json CHANGED
@@ -82,7 +82,7 @@
82
82
  "react-dom": "^17.0.0 || ^18.0.0"
83
83
  },
84
84
  "name": "@visns-studio/visns-components",
85
- "version": "5.7.17",
85
+ "version": "5.7.18",
86
86
  "description": "Various packages to assist in the development of our Custom Applications.",
87
87
  "main": "src/index.js",
88
88
  "files": [
@@ -463,11 +463,26 @@ const DataGrid = forwardRef(
463
463
  const handleDownload = async (d) => {
464
464
  const toastId = toast.loading('Starting download please wait...');
465
465
 
466
+ let requestConfig = {
467
+ url: '',
468
+ method: '',
469
+ param: {},
470
+ };
471
+
472
+ if (d.id) {
473
+ requestConfig.url = `/ajax/files/download/${d.id}/null`;
474
+ requestConfig.method = 'GET';
475
+ } else {
476
+ requestConfig.url = `/ajax/files/downloadByPath`;
477
+ requestConfig.method = 'POST';
478
+ requestConfig.param = d;
479
+ }
480
+
466
481
  try {
467
482
  const res = await Download(
468
- `/ajax/files/download/${d.id}/null`,
469
- 'GET',
470
- {}
483
+ requestConfig.url,
484
+ requestConfig.method,
485
+ requestConfig.param
471
486
  );
472
487
 
473
488
  if (res.data.error) {