@@ -34,31 +34,32 @@ import { actionsTray } from "../Common/FormComponents/common/styleLibrary";
3434import ChangePasswordModal from "./ChangePasswordModal" ;
3535import SearchBox from "../Common/SearchBox" ;
3636import withSuspense from "../Common/Components/withSuspense" ;
37- import {
38- CONSOLE_UI_RESOURCE ,
39- IAM_PAGES ,
40- IAM_SCOPES ,
41- } from "../../../common/SecureComponent/permissions" ;
42- import { SecureComponent } from "../../../common/SecureComponent" ;
4337
4438import { selectSAs } from "../Configurations/utils" ;
4539import DeleteMultipleServiceAccounts from "../Users/DeleteMultipleServiceAccounts" ;
4640import ServiceAccountPolicy from "./ServiceAccountPolicy" ;
47- import {
48- setErrorSnackMessage ,
49- setHelpName ,
50- setSnackBarMessage ,
51- } from "../../../systemSlice" ;
41+
5242import { selFeatures } from "../consoleSlice" ;
53- import { useAppDispatch } from "../../../store" ;
5443import TooltipWrapper from "../Common/TooltipWrapper/TooltipWrapper" ;
5544import PageHeaderWrapper from "../Common/PageHeaderWrapper/PageHeaderWrapper" ;
5645import { api } from "api" ;
5746import { errorToHandler } from "api/errors" ;
5847import HelpMenu from "../HelpMenu" ;
59- import { ServiceAccounts } from "../../../api/consoleApi" ;
60- import { usersSort } from "../../../utils/sortFunctions" ;
6148import { ACCOUNT_TABLE_COLUMNS } from "./AccountUtils" ;
49+ import { useAppDispatch } from "store" ;
50+ import { ApiError , ServiceAccounts } from "api/consoleApi" ;
51+ import {
52+ setErrorSnackMessage ,
53+ setHelpName ,
54+ setSnackBarMessage ,
55+ } from "systemSlice" ;
56+ import { usersSort } from "utils/sortFunctions" ;
57+ import { SecureComponent } from "common/SecureComponent" ;
58+ import {
59+ CONSOLE_UI_RESOURCE ,
60+ IAM_PAGES ,
61+ IAM_SCOPES ,
62+ } from "common/SecureComponent/permissions" ;
6263
6364const DeleteServiceAccount = withSuspense (
6465 React . lazy ( ( ) => import ( "./DeleteServiceAccount" ) ) ,
@@ -103,8 +104,9 @@ const Account = () => {
103104 const sortedRows = res . data . sort ( usersSort ) ;
104105 setRecords ( sortedRows ) ;
105106 } )
106- . catch ( ( err ) => {
107- dispatch ( setErrorSnackMessage ( errorToHandler ( err . error ) ) ) ;
107+ . catch ( async ( res ) => {
108+ const err = ( await res . json ( ) ) as ApiError ;
109+ dispatch ( setErrorSnackMessage ( errorToHandler ( err ) ) ) ;
108110 setLoading ( false ) ;
109111 } ) ;
110112 }
0 commit comments