@timardex/cluemart-shared 1.5.547 → 1.5.548
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-QEG3EGM6.mjs → chunk-XUQ6GKX7.mjs} +16 -5
- package/dist/chunk-XUQ6GKX7.mjs.map +1 -0
- package/dist/graphql/index.cjs +15 -4
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.mjs +1 -1
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.cjs +15 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +15 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-QEG3EGM6.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -4026,13 +4026,24 @@ var useGetEventsByRegion = (region, options) => {
|
|
|
4026
4026
|
};
|
|
4027
4027
|
};
|
|
4028
4028
|
var useSearchEvents = (region, search, tags) => {
|
|
4029
|
+
const normalizedSearch = search?.trim() ?? "";
|
|
4030
|
+
const normalizedTags = (tags ?? []).filter(Boolean);
|
|
4031
|
+
const shouldRunQuery = Boolean(region?.trim()) && (normalizedSearch.length > 3 || normalizedTags.length > 0);
|
|
4029
4032
|
const { loading, error, data, refetch } = useQuery2(SEARCH_EVENTS, {
|
|
4030
4033
|
fetchPolicy: "network-only",
|
|
4031
|
-
skip: !
|
|
4032
|
-
variables: {
|
|
4034
|
+
skip: !shouldRunQuery,
|
|
4035
|
+
variables: {
|
|
4036
|
+
region,
|
|
4037
|
+
search: normalizedSearch,
|
|
4038
|
+
tags: normalizedTags
|
|
4039
|
+
}
|
|
4033
4040
|
});
|
|
4034
|
-
|
|
4035
|
-
|
|
4041
|
+
return {
|
|
4042
|
+
error,
|
|
4043
|
+
eventsSearch: data?.eventsSearch ?? [],
|
|
4044
|
+
loading,
|
|
4045
|
+
refetch
|
|
4046
|
+
};
|
|
4036
4047
|
};
|
|
4037
4048
|
var useGetEventsNearMe = (location) => {
|
|
4038
4049
|
const { loading, error, data, refetch } = useQuery2(GET_EVENTS_NEAR_ME, {
|