@connectedxm/client 0.1.8 → 0.1.9

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.js CHANGED
@@ -4803,7 +4803,14 @@ var useGetLevelSponsors = (levelId = "", params = {}, options = {}) => {
4803
4803
  // src/mutations/useConnectedMutation.ts
4804
4804
  var import_react_query4 = require("@tanstack/react-query");
4805
4805
  var useConnectedMutation = (mutation, options) => {
4806
- const { locale, apiUrl, getToken, organizationId, getExecuteAs } = useConnectedXM();
4806
+ const {
4807
+ locale,
4808
+ apiUrl,
4809
+ getToken,
4810
+ organizationId,
4811
+ getExecuteAs,
4812
+ onMutationError
4813
+ } = useConnectedXM();
4807
4814
  const queryClient = (0, import_react_query4.useQueryClient)();
4808
4815
  return (0, import_react_query4.useMutation)({
4809
4816
  mutationFn: (data) => mutation({
@@ -4817,7 +4824,13 @@ var useConnectedMutation = (mutation, options) => {
4817
4824
  },
4818
4825
  ...data
4819
4826
  }),
4820
- ...options
4827
+ ...options,
4828
+ onError: (error, variables, context) => {
4829
+ if (onMutationError)
4830
+ onMutationError(error, variables, context);
4831
+ if (options?.onError)
4832
+ options.onError(error, variables, context);
4833
+ }
4821
4834
  });
4822
4835
  };
4823
4836
  var useConnectedMutation_default = useConnectedMutation;
package/dist/index.mjs CHANGED
@@ -4237,7 +4237,14 @@ import {
4237
4237
  useQueryClient
4238
4238
  } from "@tanstack/react-query";
4239
4239
  var useConnectedMutation = (mutation, options) => {
4240
- const { locale, apiUrl, getToken, organizationId, getExecuteAs } = useConnectedXM();
4240
+ const {
4241
+ locale,
4242
+ apiUrl,
4243
+ getToken,
4244
+ organizationId,
4245
+ getExecuteAs,
4246
+ onMutationError
4247
+ } = useConnectedXM();
4241
4248
  const queryClient = useQueryClient();
4242
4249
  return useMutation({
4243
4250
  mutationFn: (data) => mutation({
@@ -4251,7 +4258,13 @@ var useConnectedMutation = (mutation, options) => {
4251
4258
  },
4252
4259
  ...data
4253
4260
  }),
4254
- ...options
4261
+ ...options,
4262
+ onError: (error, variables, context) => {
4263
+ if (onMutationError)
4264
+ onMutationError(error, variables, context);
4265
+ if (options?.onError)
4266
+ options.onError(error, variables, context);
4267
+ }
4255
4268
  });
4256
4269
  };
4257
4270
  var useConnectedMutation_default = useConnectedMutation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectedxm/client",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Client API javascript SDK",
5
5
  "author": "ConnectedXM Inc.",
6
6
  "repository": {