@pylonsync/react 0.3.10 → 0.3.12
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/package.json +1 -1
- package/src/hooks.ts +4 -4
package/package.json
CHANGED
package/src/hooks.ts
CHANGED
|
@@ -872,9 +872,9 @@ export function useSearch<T = Row>(
|
|
|
872
872
|
});
|
|
873
873
|
const json = (await res.json()) as {
|
|
874
874
|
hits?: T[];
|
|
875
|
-
|
|
875
|
+
facetCounts?: Record<string, Record<string, number>>;
|
|
876
876
|
total?: number;
|
|
877
|
-
|
|
877
|
+
tookMs?: number;
|
|
878
878
|
error?: { message: string };
|
|
879
879
|
};
|
|
880
880
|
if (myId !== requestIdRef.current) return; // stale — newer in flight
|
|
@@ -882,9 +882,9 @@ export function useSearch<T = Row>(
|
|
|
882
882
|
throw new Error(json.error?.message ?? `HTTP ${res.status}`);
|
|
883
883
|
}
|
|
884
884
|
setHits(json.hits ?? []);
|
|
885
|
-
setFacetCounts(json.
|
|
885
|
+
setFacetCounts(json.facetCounts ?? {});
|
|
886
886
|
setTotal(json.total ?? 0);
|
|
887
|
-
setTookMs(json.
|
|
887
|
+
setTookMs(json.tookMs ?? 0);
|
|
888
888
|
} catch (e) {
|
|
889
889
|
if (myId !== requestIdRef.current) return; // stale — ignore
|
|
890
890
|
if ((e as Error)?.name === "AbortError") return;
|