File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
portal-ui/src/screens/Console
Configurations/ConfigurationPanels Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ import {
3232 setSnackBarMessage ,
3333} from "../../../../systemSlice" ;
3434import { useAppDispatch } from "../../../../store" ;
35+ import { ApiError } from "../../../../api/consoleApi" ;
3536
3637interface IAddAccessRule {
3738 modalOpen : boolean ;
@@ -78,8 +79,8 @@ const AddAccessRule = ({
7879 dispatch ( setSnackBarMessage ( "Access Rule added successfully" ) ) ;
7980 onClose ( ) ;
8081 } )
81- . catch ( ( err ) => {
82- dispatch ( setErrorSnackMessage ( errorToHandler ( err ) ) ) ;
82+ . catch ( ( res ) => {
83+ dispatch ( setErrorSnackMessage ( errorToHandler ( res . error ) ) ) ;
8384 onClose ( ) ;
8485 } ) ;
8586 } ;
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ import { hasPermission } from "../../../../../common/SecureComponent";
7171import BucketNamingRules from "./BucketNamingRules" ;
7272import PageHeaderWrapper from "../../../Common/PageHeaderWrapper/PageHeaderWrapper" ;
7373import { api } from "../../../../../api" ;
74- import { ObjectRetentionMode } from "../../../../../api/consoleApi" ;
74+ import { ApiError , ObjectRetentionMode } from "../../../../../api/consoleApi" ;
7575import { errorToHandler } from "../../../../../api/errors" ;
7676import HelpMenu from "../../../HelpMenu" ;
7777import CSVMultiSelector from "../../../Common/FormComponents/CSVMultiSelector/CSVMultiSelector" ;
@@ -191,7 +191,8 @@ const AddBucket = () => {
191191 dispatch ( setErrorSnackMessage ( errorToHandler ( res . error ) ) ) ;
192192 }
193193 } )
194- . catch ( ( err ) => {
194+ . catch ( async ( res ) => {
195+ const err = ( await res . json ( ) ) as ApiError ;
195196 dispatch ( setErrorSnackMessage ( errorToHandler ( err ) ) ) ;
196197 } ) ;
197198 } ;
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ import { useAppDispatch } from "../../../../store";
4646import { api } from "../../../../api" ;
4747import { IElement } from "../types" ;
4848import { errorToHandler } from "../../../../api/errors" ;
49+ import { ApiError } from "../../../../api/consoleApi" ;
4950
5051const getRoutePath = ( path : string ) => {
5152 return `${ IAM_PAGES . SETTINGS } /${ path } ` ;
@@ -79,7 +80,8 @@ const ConfigurationOptions = () => {
7980 setConfigSubSysList ( confSubSysList ) ;
8081 }
8182 } )
82- . catch ( ( err ) => {
83+ . catch ( async ( res ) => {
84+ const err = ( await res . json ( ) ) as ApiError ;
8385 dispatch ( setErrorSnackMessage ( errorToHandler ( err ) ) ) ;
8486 } ) ;
8587 } , [ dispatch ] ) ;
You can’t perform that action at this time.
0 commit comments