@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.d.mts CHANGED
@@ -1225,6 +1225,7 @@ interface PostFormData {
1225
1225
  resource?: {
1226
1226
  resourceId: string;
1227
1227
  resourceType: EnumResourceType;
1228
+ resourceRegion: string;
1228
1229
  } | null;
1229
1230
  tags?: string[] | null;
1230
1231
  title: string;
package/dist/index.d.ts CHANGED
@@ -1225,6 +1225,7 @@ interface PostFormData {
1225
1225
  resource?: {
1226
1226
  resourceId: string;
1227
1227
  resourceType: EnumResourceType;
1228
+ resourceRegion: string;
1228
1229
  } | null;
1229
1230
  tags?: string[] | null;
1230
1231
  title: string;
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: !region || region === "",
4032
- variables: { region, search, tags }
4034
+ skip: !shouldRunQuery,
4035
+ variables: {
4036
+ region,
4037
+ search: normalizedSearch,
4038
+ tags: normalizedTags
4039
+ }
4033
4040
  });
4034
- const eventsSearch = data?.eventsSearch || [];
4035
- return { error, eventsSearch, loading, refetch };
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, {
@@ -5843,6 +5854,7 @@ var POST_FIELDS_FRAGMENT = gql30`
5843
5854
  postType
5844
5855
  resource {
5845
5856
  resourceId
5857
+ resourceRegion
5846
5858
  resourceType
5847
5859
  }
5848
5860
  tags
@@ -6976,6 +6988,7 @@ var postSchema = yup8.object().shape({
6976
6988
  postType: yup8.mixed().oneOf(Object.values(EnumPostType)).required(),
6977
6989
  resource: yup8.object({
6978
6990
  resourceId: yup8.string().required(),
6991
+ resourceRegion: yup8.string().required(),
6979
6992
  resourceType: yup8.mixed().oneOf(Object.values(EnumResourceType)).required()
6980
6993
  }).nullable().optional(),
6981
6994
  tags: yup8.array().of(yup8.string().required()).nullable().optional(),