@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.
package/dist/index.d.mts CHANGED
@@ -1630,7 +1630,15 @@ declare const useCreateEvent: () => {
1630
1630
  declare const useUpdateEvent: () => {
1631
1631
  error: _apollo_client.ApolloError | undefined;
1632
1632
  loading: boolean;
1633
- updateEvent: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
1633
+ updateEvent: (options?: _apollo_client.MutationFunctionOptions<{
1634
+ updateEvent: {
1635
+ _id: string;
1636
+ };
1637
+ }, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<{
1638
+ updateEvent: {
1639
+ _id: string;
1640
+ };
1641
+ }>>;
1634
1642
  };
1635
1643
  declare const useDeleteEvent: () => {
1636
1644
  deleteEvent: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
package/dist/index.d.ts CHANGED
@@ -1630,7 +1630,15 @@ declare const useCreateEvent: () => {
1630
1630
  declare const useUpdateEvent: () => {
1631
1631
  error: _apollo_client.ApolloError | undefined;
1632
1632
  loading: boolean;
1633
- updateEvent: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
1633
+ updateEvent: (options?: _apollo_client.MutationFunctionOptions<{
1634
+ updateEvent: {
1635
+ _id: string;
1636
+ };
1637
+ }, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<{
1638
+ updateEvent: {
1639
+ _id: string;
1640
+ };
1641
+ }>>;
1634
1642
  };
1635
1643
  declare const useDeleteEvent: () => {
1636
1644
  deleteEvent: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
package/dist/index.mjs CHANGED
@@ -3916,7 +3916,20 @@ var useCreateEvent = () => {
3916
3916
  var useUpdateEvent = () => {
3917
3917
  const [updateEvent, { loading, error }] = useMutation5(UPDATE_EVENT_MUTATION, {
3918
3918
  awaitRefetchQueries: true,
3919
- refetchQueries: [{ query: GET_USER_EVENTS }]
3919
+ refetchQueries: (mutationResult) => {
3920
+ const eventId = mutationResult?.data?.updateEvent?._id;
3921
+ if (!eventId) return [];
3922
+ return [
3923
+ {
3924
+ query: GET_USER_EVENTS
3925
+ },
3926
+ {
3927
+ query: GET_EVENT,
3928
+ variables: { _id: eventId }
3929
+ // Pass the eventId for refetching
3930
+ }
3931
+ ];
3932
+ }
3920
3933
  });
3921
3934
  return { error, loading, updateEvent };
3922
3935
  };