@antscorp/antsomi-ui 1.3.5-beta.850 → 1.3.5-beta.852

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.
@@ -50,6 +50,7 @@ export const Layout = memo(props => {
50
50
  const onlyContent = useLayoutStore(store => store.state.onlyContent);
51
51
  const [, , removeCookie] = useCookies();
52
52
  const params = useParams();
53
+ console.log('🚀 ~ params:', params);
53
54
  const location = useLocation();
54
55
  const { navigate, replace } = useCustomRouter();
55
56
  const [showAccountSelection, setShowAccountSelection] = useState(false);
@@ -101,12 +102,13 @@ export const Layout = memo(props => {
101
102
  clearInterval(intervalId);
102
103
  };
103
104
  }, [checkIpRestriction]);
104
- const handleRequestAccessIP = async () => {
105
+ const handleRequestAccessIP = async (message) => {
105
106
  await permissionService.requestAccess({
106
107
  env: env || 'development',
107
108
  accountId,
108
109
  token,
109
110
  userId,
111
+ message,
110
112
  });
111
113
  };
112
114
  // Memo
@@ -248,6 +250,7 @@ export const Layout = memo(props => {
248
250
  /** Handle replace current userId in params if current userId is not match */
249
251
  useDeepCompareEffect(() => {
250
252
  const { userId: userIdParam } = (params || {});
253
+ console.log('🚀 ~ useDeepCompareEffect ~ userId:', userIdParam, userId);
251
254
  if (userIdParam && userId && +userIdParam !== +userId && location.pathname) {
252
255
  replace(`${location.pathname.replace(userIdParam, `${userId}`)}${location.search}`);
253
256
  }
@@ -20,6 +20,7 @@ type RequestAccess = {
20
20
  userId?: string;
21
21
  accountId?: string;
22
22
  token?: string;
23
+ message?: string;
23
24
  };
24
25
  export declare const permissionService: {
25
26
  getAccountList: (config: TGetAccountList) => Promise<any>;
@@ -41,10 +41,8 @@ export const permissionService = {
41
41
  },
42
42
  requestAccess: async (config) => {
43
43
  try {
44
- const { env, userId, accountId, token } = config;
45
- await axios({
46
- method: 'GET',
47
- url: `${APP_IAM_DOMAIN[APP_CODES.DATAFLOWS][env]}/api/account/request-access`,
44
+ const { env, userId, accountId, token, message } = config;
45
+ await axios.post(`${APP_IAM_DOMAIN[APP_CODES.DATAFLOWS][env]}/api/account/request-access`, { message: message || '' }, {
48
46
  params: {
49
47
  _user_id: userId,
50
48
  _account_id: accountId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.850",
3
+ "version": "1.3.5-beta.852",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",