@axcode/axcloud-sdk 0.1.3 → 0.1.4

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
@@ -796,11 +796,11 @@ function useMySection(options = {}) {
796
796
  if (!sectionId) {
797
797
  throw new Error("User is not assigned to a section");
798
798
  }
799
- const section = await client.get(
799
+ const response = await client.get(
800
800
  `/orgs/api/organizations/${orgId}/sections/${sectionId}`,
801
801
  { includeMembers: includeMembers ? "true" : void 0 }
802
802
  );
803
- return section;
803
+ return "success" in response && response.data ? response.data : response;
804
804
  },
805
805
  enabled: isAuthenticated && !isUserLoading && !!sectionId,
806
806
  staleTime: 1e3 * 60 * 5
@@ -826,7 +826,8 @@ function useSections() {
826
826
  const query = reactQuery.useQuery({
827
827
  queryKey: ["axcloud", "sections", orgId, stage],
828
828
  queryFn: async () => {
829
- return client.get(`/orgs/api/organizations/${orgId}/sections`);
829
+ const response = await client.get(`/orgs/api/organizations/${orgId}/sections`);
830
+ return "success" in response && response.data ? response.data : response;
830
831
  },
831
832
  staleTime: 1e3 * 60 * 10
832
833
  // 10 minutes