@axcode/axcloud-sdk 0.1.2 → 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.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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
|
|
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
|
|
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,13 +824,14 @@ function useSections() {
|
|
|
824
824
|
const query = useQuery({
|
|
825
825
|
queryKey: ["axcloud", "sections", orgId, stage],
|
|
826
826
|
queryFn: async () => {
|
|
827
|
-
|
|
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
|
|
831
832
|
});
|
|
832
833
|
return {
|
|
833
|
-
sections: query.data ?? [],
|
|
834
|
+
sections: query.data?.sections ?? [],
|
|
834
835
|
isLoading: query.isLoading,
|
|
835
836
|
isError: query.isError,
|
|
836
837
|
error: query.error,
|