@timardex/cluemart-shared 2.0.0 → 2.0.1
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/{chunk-JJQL6LZE.mjs → chunk-D45RNLV2.mjs} +1 -1
- package/dist/chunk-D45RNLV2.mjs.map +1 -0
- package/dist/{chunk-XPUYQ7GB.mjs → chunk-GRP7XQNB.mjs} +11 -7
- package/dist/{chunk-XPUYQ7GB.mjs.map → chunk-GRP7XQNB.mjs.map} +1 -1
- package/dist/{chunk-L3SNS6OJ.mjs → chunk-XED54CPG.mjs} +2 -2
- package/dist/formFields/index.mjs +2 -2
- package/dist/graphql/index.cjs +9 -5
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +1 -1
- package/dist/graphql/index.d.ts +1 -1
- package/dist/graphql/index.mjs +1 -1
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +3 -3
- package/dist/index.cjs +9 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +10 -6
- package/dist/index.mjs.map +1 -1
- package/dist/{resourceActivities-BvejCLh9.d.mts → resourceActivities-BJAI4jf-.d.mts} +1 -1
- package/dist/{resourceActivities-Smsl03Je.d.ts → resourceActivities-BW648M1v.d.ts} +1 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/utils/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-JJQL6LZE.mjs.map +0 -1
- /package/dist/{chunk-L3SNS6OJ.mjs.map → chunk-XED54CPG.mjs.map} +0 -0
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
|
|
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
|
|
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
|
|
8563
|
-
...
|
|
8566
|
+
return refetchRef.current({
|
|
8567
|
+
...variablesRef.current,
|
|
8564
8568
|
options: { limit: pageSize + 1, offset: 0 }
|
|
8565
8569
|
});
|
|
8566
|
-
}, [
|
|
8570
|
+
}, [pageSize, skip]);
|
|
8567
8571
|
return {
|
|
8568
8572
|
error,
|
|
8569
8573
|
hasMore,
|