@timardex/cluemart-shared 1.5.586 → 1.5.587

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.
@@ -5,7 +5,7 @@ import {
5
5
  normalizeUrl,
6
6
  timeFormat
7
7
  } from "../chunk-L74HNX7U.mjs";
8
- import "../chunk-YGKLLYKV.mjs";
8
+ import "../chunk-P52HS2NB.mjs";
9
9
  import {
10
10
  EnumEventDateStatus,
11
11
  EnumEventType,
package/dist/index.cjs CHANGED
@@ -4247,7 +4247,20 @@ var useCreateEvent = () => {
4247
4247
  var useUpdateEvent = () => {
4248
4248
  const [updateEvent, { loading, error }] = (0, import_client18.useMutation)(UPDATE_EVENT_MUTATION, {
4249
4249
  awaitRefetchQueries: true,
4250
- refetchQueries: [{ query: GET_USER_EVENTS }]
4250
+ refetchQueries: (mutationResult) => {
4251
+ const eventId = mutationResult?.data?.updateEvent?._id;
4252
+ if (!eventId) return [];
4253
+ return [
4254
+ {
4255
+ query: GET_USER_EVENTS
4256
+ },
4257
+ {
4258
+ query: GET_EVENT,
4259
+ variables: { _id: eventId }
4260
+ // Pass the eventId for refetching
4261
+ }
4262
+ ];
4263
+ }
4251
4264
  });
4252
4265
  return { error, loading, updateEvent };
4253
4266
  };