@timardex/cluemart-shared 2.0.0 → 2.0.2

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.d.mts CHANGED
@@ -1564,7 +1564,7 @@ type ResourceActivityType = {
1564
1564
  type ResourceActivityInputType = {
1565
1565
  resourceId: string;
1566
1566
  resourceType: EnumResourceType;
1567
- activity: Omit<ResourceActivityEntry, "timestamp">;
1567
+ activity: Omit<ResourceActivityEntry, "timestamp" | "userId">;
1568
1568
  };
1569
1569
 
1570
1570
  interface PartnerFormData extends BaseResourceTypeFormData {
package/dist/index.d.ts CHANGED
@@ -1564,7 +1564,7 @@ type ResourceActivityType = {
1564
1564
  type ResourceActivityInputType = {
1565
1565
  resourceId: string;
1566
1566
  resourceType: EnumResourceType;
1567
- activity: Omit<ResourceActivityEntry, "timestamp">;
1567
+ activity: Omit<ResourceActivityEntry, "timestamp" | "userId">;
1568
1568
  };
1569
1569
 
1570
1570
  interface PartnerFormData extends BaseResourceTypeFormData {
package/dist/index.mjs CHANGED
@@ -8486,7 +8486,7 @@ var useGetCoupon = (_id) => {
8486
8486
 
8487
8487
  // src/graphql/hooks/usePaginatedList.ts
8488
8488
  import { useQuery as useQuery18 } from "@apollo/client";
8489
- import { useCallback, useEffect, useState } from "react";
8489
+ import { useCallback, useEffect, useRef, useState } from "react";
8490
8490
  function usePaginatedList({
8491
8491
  document,
8492
8492
  getItems,
@@ -8516,6 +8516,10 @@ function usePaginatedList({
8516
8516
  skip,
8517
8517
  variables: { ...variables, options: { limit: pageSize + 1, offset } }
8518
8518
  });
8519
+ const refetchRef = useRef(refetch);
8520
+ refetchRef.current = refetch;
8521
+ const variablesRef = useRef(variables);
8522
+ variablesRef.current = variables;
8519
8523
  const rawPage = getItems(data);
8520
8524
  const page = rawPage.length > pageSize ? rawPage.slice(0, pageSize) : rawPage;
8521
8525
  const hasMorePage = rawPage.length > pageSize;
@@ -8540,7 +8544,7 @@ function usePaginatedList({
8540
8544
  return;
8541
8545
  }
8542
8546
  if (error) {
8543
- void refetch();
8547
+ void refetchRef.current();
8544
8548
  return;
8545
8549
  }
8546
8550
  if (!hasSettled) {
@@ -8550,7 +8554,7 @@ function usePaginatedList({
8550
8554
  return;
8551
8555
  }
8552
8556
  setOffset(offset + pageSize);
8553
- }, [loading, skip, error, hasSettled, hasMore, offset, pageSize, refetch]);
8557
+ }, [loading, skip, error, hasSettled, hasMore, offset, pageSize]);
8554
8558
  const refresh = useCallback(() => {
8555
8559
  setItems([]);
8556
8560
  setHasMore(!skip);
@@ -8559,11 +8563,11 @@ function usePaginatedList({
8559
8563
  if (skip) {
8560
8564
  return Promise.resolve();
8561
8565
  }
8562
- return refetch({
8563
- ...variables,
8566
+ return refetchRef.current({
8567
+ ...variablesRef.current,
8564
8568
  options: { limit: pageSize + 1, offset: 0 }
8565
8569
  });
8566
- }, [refetch, variables, pageSize, skip]);
8570
+ }, [pageSize, skip]);
8567
8571
  return {
8568
8572
  error,
8569
8573
  hasMore,