@shipengine/react-api 0.5.2 → 0.5.3

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.
@@ -1,10 +1,5 @@
1
1
  import { SE } from "@shipengine/js-api";
2
- export type UpdateAccountSettingsData = SE.AccountSettings;
3
2
  /**
4
3
  * @category ShipEngine API Hooks
5
4
  * */
6
- export declare const useUpdateAccountSettings: () => import("react-query").UseMutationResult<{
7
- defaultLabelLayout: string;
8
- dimension: string;
9
- weight: string;
10
- }, SE.CodedError[], SE.AccountSettings, unknown>;
5
+ export declare const useUpdateAccountSettings: () => import("react-query").UseMutationResult<SE.AccountSettings, SE.CodedError[], Partial<SE.AccountSettings>, unknown>;
package/index.js CHANGED
@@ -746,14 +746,10 @@ var __async$6 = (__this, __arguments, generator) => {
746
746
  });
747
747
  };
748
748
  const useUpdateAccountSettings = () => {
749
+ const { client } = useShipEngine();
749
750
  return reactQuery.useMutation({
750
- mutationFn: (_settings) => __async$6(void 0, null, function* () {
751
- const result = yield Promise.resolve({
752
- data: { defaultLabelLayout: "4x6", dimension: "inch", weight: "ounce" },
753
- errors: [],
754
- isLoading: false,
755
- isValidating: false
756
- });
751
+ mutationFn: (settings) => __async$6(void 0, null, function* () {
752
+ const result = yield client.accountSettings.update(settings);
757
753
  return result.data;
758
754
  }),
759
755
  mutationKey: ["useUpdateAccountSettings"],
package/index.mjs CHANGED
@@ -743,14 +743,10 @@ var __async$6 = (__this, __arguments, generator) => {
743
743
  });
744
744
  };
745
745
  const useUpdateAccountSettings = () => {
746
+ const { client } = useShipEngine();
746
747
  return useMutation({
747
- mutationFn: (_settings) => __async$6(void 0, null, function* () {
748
- const result = yield Promise.resolve({
749
- data: { defaultLabelLayout: "4x6", dimension: "inch", weight: "ounce" },
750
- errors: [],
751
- isLoading: false,
752
- isValidating: false
753
- });
748
+ mutationFn: (settings) => __async$6(void 0, null, function* () {
749
+ const result = yield client.accountSettings.update(settings);
754
750
  return result.data;
755
751
  }),
756
752
  mutationKey: ["useUpdateAccountSettings"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/react-api",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {