strapi-plugin-bulk-updater 1.2.10 → 1.2.11

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.
@@ -1790,10 +1790,13 @@ const BulkUpdater = () => {
1790
1790
  }
1791
1791
  }
1792
1792
  } catch (err) {
1793
- toggleNotification({
1794
- type: "danger",
1795
- message: err.message || "Failed to load collections data"
1796
- });
1793
+ const isAborted = err?.name === "AbortError" || err?.name === "CanceledError" || err?.code === "ERR_CANCELED" || err?.message?.includes("aborted") || err?.message?.includes("canceled");
1794
+ if (!isAborted) {
1795
+ toggleNotification({
1796
+ type: "danger",
1797
+ message: err?.message || "Failed to load collections data"
1798
+ });
1799
+ }
1797
1800
  } finally {
1798
1801
  setLoading(false);
1799
1802
  }
@@ -1834,13 +1837,17 @@ const BulkUpdater = () => {
1834
1837
  const res = await get(`/bulk-updater/collections/${colUid}/entries?${params.toString()}`);
1835
1838
  if (res.data && (res.data.success || res.data.entries !== void 0)) {
1836
1839
  const fetchedEntries = res.data.entries || [];
1840
+ const pageNum = res.data.pagination?.page ?? targetPage ?? 1;
1841
+ const pageSizeNum = res.data.pagination?.pageSize ?? size ?? defaultPageSize;
1842
+ const totalNum = res.data.pagination?.total !== void 0 ? res.data.pagination.total : fetchedEntries.length;
1843
+ const pageCountNum = res.data.pagination?.pageCount ?? Math.max(1, Math.ceil(totalNum / pageSizeNum));
1837
1844
  setCollectionPages((prev) => ({
1838
1845
  ...prev,
1839
1846
  [colUid]: {
1840
- page: res.data.pagination.page,
1841
- pageSize: res.data.pagination.pageSize,
1842
- total: res.data.pagination.total,
1843
- pageCount: res.data.pagination.pageCount,
1847
+ page: pageNum,
1848
+ pageSize: pageSizeNum,
1849
+ total: totalNum,
1850
+ pageCount: pageCountNum,
1844
1851
  entries: fetchedEntries,
1845
1852
  loading: false
1846
1853
  }
@@ -1857,10 +1864,13 @@ const BulkUpdater = () => {
1857
1864
  }
1858
1865
  }
1859
1866
  } catch (err) {
1860
- toggleNotification({
1861
- type: "danger",
1862
- message: `Failed to load entries for ${colUid}: ${err.message}`
1863
- });
1867
+ const isAborted = err?.name === "AbortError" || err?.name === "CanceledError" || err?.code === "ERR_CANCELED" || err?.message?.includes("aborted") || err?.message?.includes("canceled");
1868
+ if (!isAborted) {
1869
+ toggleNotification({
1870
+ type: "danger",
1871
+ message: `Failed to load entries for ${colUid}: ${err?.message || "Network error"}`
1872
+ });
1873
+ }
1864
1874
  setCollectionPages((prev) => ({
1865
1875
  ...prev,
1866
1876
  [colUid]: {
@@ -1884,10 +1894,13 @@ const BulkUpdater = () => {
1884
1894
  }
1885
1895
  }
1886
1896
  } catch (err) {
1887
- toggleNotification({
1888
- type: "danger",
1889
- message: err.message || "Failed to fetch audit history."
1890
- });
1897
+ const isAborted = err?.name === "AbortError" || err?.name === "CanceledError" || err?.code === "ERR_CANCELED" || err?.message?.includes("aborted") || err?.message?.includes("canceled");
1898
+ if (!isAborted) {
1899
+ toggleNotification({
1900
+ type: "danger",
1901
+ message: err?.message || "Failed to fetch audit history."
1902
+ });
1903
+ }
1891
1904
  } finally {
1892
1905
  setAuditLoading(false);
1893
1906
  }
@@ -4257,4 +4270,4 @@ exports.default = BulkUpdater;
4257
4270
  exports.formatDisplayValue = formatDisplayValue;
4258
4271
  exports.getAvailableColumnsForCollection = getAvailableColumnsForCollection;
4259
4272
  exports.getNestedValue = getNestedValue;
4260
- //# sourceMappingURL=BulkUpdater-EI4sKaLN.js.map
4273
+ //# sourceMappingURL=BulkUpdater-DS6gm_qd.js.map