@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/hooks/index.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -4351,13 +4351,24 @@ var useGetEventsByRegion = (region, options) => {
|
|
|
4351
4351
|
};
|
|
4352
4352
|
};
|
|
4353
4353
|
var useSearchEvents = (region, search, tags) => {
|
|
4354
|
+
const normalizedSearch = search?.trim() ?? "";
|
|
4355
|
+
const normalizedTags = (tags ?? []).filter(Boolean);
|
|
4356
|
+
const shouldRunQuery = Boolean(region?.trim()) && (normalizedSearch.length > 3 || normalizedTags.length > 0);
|
|
4354
4357
|
const { loading, error, data, refetch } = (0, import_client19.useQuery)(SEARCH_EVENTS, {
|
|
4355
4358
|
fetchPolicy: "network-only",
|
|
4356
|
-
skip: !
|
|
4357
|
-
variables: {
|
|
4359
|
+
skip: !shouldRunQuery,
|
|
4360
|
+
variables: {
|
|
4361
|
+
region,
|
|
4362
|
+
search: normalizedSearch,
|
|
4363
|
+
tags: normalizedTags
|
|
4364
|
+
}
|
|
4358
4365
|
});
|
|
4359
|
-
|
|
4360
|
-
|
|
4366
|
+
return {
|
|
4367
|
+
error,
|
|
4368
|
+
eventsSearch: data?.eventsSearch ?? [],
|
|
4369
|
+
loading,
|
|
4370
|
+
refetch
|
|
4371
|
+
};
|
|
4361
4372
|
};
|
|
4362
4373
|
var useGetEventsNearMe = (location) => {
|
|
4363
4374
|
const { loading, error, data, refetch } = (0, import_client19.useQuery)(GET_EVENTS_NEAR_ME, {
|