@antscorp/antsomi-ui 1.7.1 → 1.7.2

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.
@@ -17,7 +17,7 @@ export const useAccountSelection = (apiConfig) => {
17
17
  const { data } = useGetAccountList({
18
18
  apiConfig,
19
19
  options: {
20
- enabled: !isUsePermissionAccount(appCode || ''),
20
+ enabled: !isUsePermissionAccount(appCode || '') && !!token && !!apiConfig.portalId,
21
21
  },
22
22
  });
23
23
  const { data: permissionAccountList } = useGetPermissionAccountList({
@@ -32,7 +32,7 @@ export const useAccountSelection = (apiConfig) => {
32
32
  menuCode: menuCode || appCode || '',
33
33
  },
34
34
  options: {
35
- enabled: isUsePermissionAccount(appCode || ''),
35
+ enabled: isUsePermissionAccount(appCode || '') && !!token && !!userId,
36
36
  },
37
37
  });
38
38
  const { data: recentData } = useGetRecentAccount({
@@ -7,7 +7,7 @@ import { QUERY_KEYS } from '../../constants/queries';
7
7
  const { getList, getRecentAccount } = accountService;
8
8
  export const useGetAccountList = (props) => {
9
9
  const { apiConfig, options } = props;
10
- return useQuery(Object.assign({ queryKey: [QUERY_KEYS.GET_ACCOUNT_LISTING], queryFn: () => getList(apiConfig) }, options));
10
+ return useQuery(Object.assign({ queryKey: [QUERY_KEYS.GET_ACCOUNT_LISTING, apiConfig], queryFn: () => getList(apiConfig) }, options));
11
11
  };
12
12
  export const useGetRecentAccount = (props) => {
13
13
  const { apiConfig, options } = props;
@@ -6,5 +6,5 @@ import { permissionService } from '../../services/Permission';
6
6
  import { QUERY_KEYS } from '../../constants';
7
7
  export const useGetPermissionAccountList = (props) => {
8
8
  const { args, options } = props;
9
- return useQuery(Object.assign({ queryKey: [QUERY_KEYS.GET_PERMISSION_ACCOUNT_LISTING], queryFn: () => permissionService.getAccountList(args) }, options));
9
+ return useQuery(Object.assign({ queryKey: [QUERY_KEYS.GET_PERMISSION_ACCOUNT_LISTING, args], queryFn: () => permissionService.getAccountList(args) }, options));
10
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",