shelflife-react-hooks 1.0.14 → 1.0.16

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/index.cjs.js CHANGED
@@ -511,10 +511,10 @@ var fetchProductsRequest = async (config, search, size, page) => runWithRequestS
511
511
  }
512
512
  const payload = await readJson(response);
513
513
  if (payload) {
514
- config.setProducts(payload);
514
+ config.setProducts(payload.data);
515
515
  return payload;
516
516
  }
517
- return [];
517
+ return { data: [], currentPage: 0, hasNext: false, hasPrevious: false, pageSize: 0, totalItems: 0, totalPages: 0 };
518
518
  });
519
519
  var fetchProductRequest = async (config, id) => runWithRequestState(config, async () => {
520
520
  const normalizedBaseUrl = normalizeBaseUrl(config.baseUrl);
@@ -883,10 +883,10 @@ var fetchStoragesRequest = async (config, search, size, page) => runWithRequestS
883
883
  }
884
884
  const payload = await readJson(response);
885
885
  if (payload) {
886
- config.setStorages(payload);
886
+ config.setStorages(payload.data);
887
887
  return payload;
888
888
  }
889
- return [];
889
+ return { data: [], currentPage: 0, hasNext: false, hasPrevious: false, pageSize: 0, totalItems: 0, totalPages: 0 };
890
890
  }
891
891
  );
892
892
  var fetchStorageRequest = async (config, id) => runWithRequestState(config, async () => {
@@ -989,7 +989,7 @@ var StorageProvider = ({ baseUrl, children }) => {
989
989
  setIsError,
990
990
  setError
991
991
  }), [baseUrl, token]);
992
- const fetchStorages = (0, import_react5.useCallback)((search = "", size = 0, page = 0) => fetchStoragesRequest(apiConfig, search, page, size), [apiConfig]);
992
+ const fetchStorages = (0, import_react5.useCallback)((search = "", size = 0, page = 0) => fetchStoragesRequest(apiConfig, search, size, page), [apiConfig]);
993
993
  const fetchStorage = (0, import_react5.useCallback)((id) => fetchStorageRequest(apiConfig, id), [apiConfig]);
994
994
  const createStorage = (0, import_react5.useCallback)(
995
995
  (dto) => createStorageRequest(apiConfig, dto),