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