@timardex/cluemart-shared 1.7.84 → 1.7.86

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.
@@ -46,7 +46,7 @@ import {
46
46
  import {
47
47
  availableCategories,
48
48
  categoryColors
49
- } from "../chunk-5RXL62LO.mjs";
49
+ } from "../chunk-RCARDOVS.mjs";
50
50
  import "../chunk-2UNNIQIK.mjs";
51
51
  import "../chunk-364EX22V.mjs";
52
52
  import "../chunk-RAYUJODN.mjs";
@@ -2932,7 +2932,14 @@ var useCreateVendor = () => {
2932
2932
  var useUpdateVendor = () => {
2933
2933
  const [updateVendor, { loading, error }] = (0, import_client39.useMutation)(UPDATE_VENDOR_MUTATION, {
2934
2934
  awaitRefetchQueries: true,
2935
- refetchQueries: [{ query: GET_USER_VENDORS }]
2935
+ refetchQueries: (mutationResult) => {
2936
+ const vendorId = mutationResult?.data?.updateVendor?.data?._id;
2937
+ if (!vendorId) return [];
2938
+ return [
2939
+ { query: GET_USER_VENDORS },
2940
+ { query: GET_VENDOR, variables: { _id: vendorId } }
2941
+ ];
2942
+ }
2936
2943
  });
2937
2944
  return { error, loading, updateVendor };
2938
2945
  };
@@ -3941,7 +3948,14 @@ var useCreatePartner = () => {
3941
3948
  var useUpdatePartner = () => {
3942
3949
  const [updatePartner, { loading, error }] = (0, import_client57.useMutation)(UPDATE_PARTNER_MUTATION, {
3943
3950
  awaitRefetchQueries: true,
3944
- refetchQueries: [{ query: GET_USER_PARTNERS }]
3951
+ refetchQueries: (mutationResult) => {
3952
+ const partnerId = mutationResult?.data?.updatePartner?.data?._id;
3953
+ if (!partnerId) return [];
3954
+ return [
3955
+ { query: GET_USER_PARTNERS },
3956
+ { query: GET_PARTNER, variables: { _id: partnerId } }
3957
+ ];
3958
+ }
3945
3959
  });
3946
3960
  return { error, loading, updatePartner };
3947
3961
  };