@timardex/cluemart-shared 1.5.547 → 1.5.549

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.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: !region || region === "",
4357
- variables: { region, search, tags }
4359
+ skip: !shouldRunQuery,
4360
+ variables: {
4361
+ region,
4362
+ search: normalizedSearch,
4363
+ tags: normalizedTags
4364
+ }
4358
4365
  });
4359
- const eventsSearch = data?.eventsSearch || [];
4360
- return { error, eventsSearch, loading, refetch };
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, {
@@ -6168,6 +6179,7 @@ var POST_FIELDS_FRAGMENT = import_client56.gql`
6168
6179
  postType
6169
6180
  resource {
6170
6181
  resourceId
6182
+ resourceRegion
6171
6183
  resourceType
6172
6184
  }
6173
6185
  tags
@@ -7301,6 +7313,7 @@ var postSchema = yup8.object().shape({
7301
7313
  postType: yup8.mixed().oneOf(Object.values(EnumPostType)).required(),
7302
7314
  resource: yup8.object({
7303
7315
  resourceId: yup8.string().required(),
7316
+ resourceRegion: yup8.string().required(),
7304
7317
  resourceType: yup8.mixed().oneOf(Object.values(EnumResourceType)).required()
7305
7318
  }).nullable().optional(),
7306
7319
  tags: yup8.array().of(yup8.string().required()).nullable().optional(),