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.
@@ -1786,10 +1786,13 @@ const BulkUpdater = () => {
1786
1786
  }
1787
1787
  }
1788
1788
  } catch (err) {
1789
- toggleNotification({
1790
- type: "danger",
1791
- message: err.message || "Failed to load collections data"
1792
- });
1789
+ const isAborted = err?.name === "AbortError" || err?.name === "CanceledError" || err?.code === "ERR_CANCELED" || err?.message?.includes("aborted") || err?.message?.includes("canceled");
1790
+ if (!isAborted) {
1791
+ toggleNotification({
1792
+ type: "danger",
1793
+ message: err?.message || "Failed to load collections data"
1794
+ });
1795
+ }
1793
1796
  } finally {
1794
1797
  setLoading(false);
1795
1798
  }
@@ -1830,13 +1833,17 @@ const BulkUpdater = () => {
1830
1833
  const res = await get(`/bulk-updater/collections/${colUid}/entries?${params.toString()}`);
1831
1834
  if (res.data && (res.data.success || res.data.entries !== void 0)) {
1832
1835
  const fetchedEntries = res.data.entries || [];
1836
+ const pageNum = res.data.pagination?.page ?? targetPage ?? 1;
1837
+ const pageSizeNum = res.data.pagination?.pageSize ?? size ?? defaultPageSize;
1838
+ const totalNum = res.data.pagination?.total !== void 0 ? res.data.pagination.total : fetchedEntries.length;
1839
+ const pageCountNum = res.data.pagination?.pageCount ?? Math.max(1, Math.ceil(totalNum / pageSizeNum));
1833
1840
  setCollectionPages((prev) => ({
1834
1841
  ...prev,
1835
1842
  [colUid]: {
1836
- page: res.data.pagination.page,
1837
- pageSize: res.data.pagination.pageSize,
1838
- total: res.data.pagination.total,
1839
- pageCount: res.data.pagination.pageCount,
1843
+ page: pageNum,
1844
+ pageSize: pageSizeNum,
1845
+ total: totalNum,
1846
+ pageCount: pageCountNum,
1840
1847
  entries: fetchedEntries,
1841
1848
  loading: false
1842
1849
  }
@@ -1853,10 +1860,13 @@ const BulkUpdater = () => {
1853
1860
  }
1854
1861
  }
1855
1862
  } catch (err) {
1856
- toggleNotification({
1857
- type: "danger",
1858
- message: `Failed to load entries for ${colUid}: ${err.message}`
1859
- });
1863
+ const isAborted = err?.name === "AbortError" || err?.name === "CanceledError" || err?.code === "ERR_CANCELED" || err?.message?.includes("aborted") || err?.message?.includes("canceled");
1864
+ if (!isAborted) {
1865
+ toggleNotification({
1866
+ type: "danger",
1867
+ message: `Failed to load entries for ${colUid}: ${err?.message || "Network error"}`
1868
+ });
1869
+ }
1860
1870
  setCollectionPages((prev) => ({
1861
1871
  ...prev,
1862
1872
  [colUid]: {
@@ -1880,10 +1890,13 @@ const BulkUpdater = () => {
1880
1890
  }
1881
1891
  }
1882
1892
  } catch (err) {
1883
- toggleNotification({
1884
- type: "danger",
1885
- message: err.message || "Failed to fetch audit history."
1886
- });
1893
+ const isAborted = err?.name === "AbortError" || err?.name === "CanceledError" || err?.code === "ERR_CANCELED" || err?.message?.includes("aborted") || err?.message?.includes("canceled");
1894
+ if (!isAborted) {
1895
+ toggleNotification({
1896
+ type: "danger",
1897
+ message: err?.message || "Failed to fetch audit history."
1898
+ });
1899
+ }
1887
1900
  } finally {
1888
1901
  setAuditLoading(false);
1889
1902
  }
@@ -4255,4 +4268,4 @@ export {
4255
4268
  getAvailableColumnsForCollection,
4256
4269
  getNestedValue
4257
4270
  };
4258
- //# sourceMappingURL=BulkUpdater-Cg9utqzm.mjs.map
4271
+ //# sourceMappingURL=BulkUpdater-B_COVQmo.mjs.map