flowcore-fn 9.5.2 → 9.5.3

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/dist/pkg-index.js CHANGED
@@ -5638,15 +5638,19 @@ function DocumentConfigTable({
5638
5638
  setIsDeleteOpen(true);
5639
5639
  };
5640
5640
  const handleSaveEdit = async (updatedData) => {
5641
- var _a, _b, _c, _d, _e;
5641
+ var _a, _b, _c, _d, _e, _f;
5642
5642
  try {
5643
5643
  const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.documentConfiguration) == null ? void 0 : _c.update;
5644
5644
  if (!endpoint) throw new Error("Document Configuration update endpoint is not configured.");
5645
+ const maxSizeMB = Number.parseFloat((_d = updatedData.maxSizeNum) != null ? _d : updatedData.maxSize);
5646
+ if (!Number.isFinite(maxSizeMB) || maxSizeMB <= 0) {
5647
+ throw new Error("Please enter a valid maximum size in MB.");
5648
+ }
5645
5649
  await getApiService().put(endpoint, {
5646
5650
  documentConfigurationId: updatedData.id,
5647
5651
  documentName: updatedData.docName.trim(),
5648
5652
  allowedExtensions: updatedData.extensions.trim(),
5649
- maxSizeMB: Number(updatedData.maxSizeNum),
5653
+ maxSizeMB,
5650
5654
  isMandatory: Boolean(updatedData.isMandatory),
5651
5655
  isActive: updatedData.status === "Active",
5652
5656
  updatedBy: "System"
@@ -5656,7 +5660,7 @@ function DocumentConfigTable({
5656
5660
  await loadData();
5657
5661
  return true;
5658
5662
  } catch (error) {
5659
- await import_sweetalert211.default.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to update document configuration.", "error");
5663
+ await import_sweetalert211.default.fire("Error", ((_f = (_e = error == null ? void 0 : error.response) == null ? void 0 : _e.data) == null ? void 0 : _f.message) || (error == null ? void 0 : error.message) || "Unable to update document configuration.", "error");
5660
5664
  return false;
5661
5665
  }
5662
5666
  };
@@ -5496,15 +5496,19 @@ function DocumentConfigTable({
5496
5496
  setIsDeleteOpen(true);
5497
5497
  };
5498
5498
  const handleSaveEdit = async (updatedData) => {
5499
- var _a, _b, _c, _d, _e;
5499
+ var _a, _b, _c, _d, _e, _f;
5500
5500
  try {
5501
5501
  const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.documentConfiguration) == null ? void 0 : _c.update;
5502
5502
  if (!endpoint) throw new Error("Document Configuration update endpoint is not configured.");
5503
+ const maxSizeMB = Number.parseFloat((_d = updatedData.maxSizeNum) != null ? _d : updatedData.maxSize);
5504
+ if (!Number.isFinite(maxSizeMB) || maxSizeMB <= 0) {
5505
+ throw new Error("Please enter a valid maximum size in MB.");
5506
+ }
5503
5507
  await getApiService().put(endpoint, {
5504
5508
  documentConfigurationId: updatedData.id,
5505
5509
  documentName: updatedData.docName.trim(),
5506
5510
  allowedExtensions: updatedData.extensions.trim(),
5507
- maxSizeMB: Number(updatedData.maxSizeNum),
5511
+ maxSizeMB,
5508
5512
  isMandatory: Boolean(updatedData.isMandatory),
5509
5513
  isActive: updatedData.status === "Active",
5510
5514
  updatedBy: "System"
@@ -5514,7 +5518,7 @@ function DocumentConfigTable({
5514
5518
  await loadData();
5515
5519
  return true;
5516
5520
  } catch (error) {
5517
- await Swal11.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to update document configuration.", "error");
5521
+ await Swal11.fire("Error", ((_f = (_e = error == null ? void 0 : error.response) == null ? void 0 : _e.data) == null ? void 0 : _f.message) || (error == null ? void 0 : error.message) || "Unable to update document configuration.", "error");
5518
5522
  return false;
5519
5523
  }
5520
5524
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowcore-fn",
3
- "version": "9.5.2",
3
+ "version": "9.5.3",
4
4
  "main": "dist/pkg-index.js",
5
5
  "module": "dist/pkg-index.mjs",
6
6
  "files": [