File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export const errorToHandler = (e: Error): ErrorResponseHandler => {
29
29
}
30
30
return {
31
31
statusCode : e . code ,
32
- errorMessage : e . message ,
33
- detailedError : e . detailedMessage ,
32
+ errorMessage : e . message || "" ,
33
+ detailedError : e . detailedMessage || "" ,
34
34
} ;
35
35
} ;
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ import { getRandomString } from "../../../common/utils";
46
46
import { api } from "api" ;
47
47
import { errorToHandler } from "api/errors" ;
48
48
import HelpMenu from "../HelpMenu" ;
49
+ import { ContentType } from "api/consoleApi" ;
49
50
50
51
const AddServiceAccount = ( ) => {
51
52
const dispatch = useAppDispatch ( ) ;
@@ -72,7 +73,7 @@ const AddServiceAccount = () => {
72
73
policy : policyJSON ,
73
74
accessKey : accessKey ,
74
75
secretKey : secretKey ,
75
- } )
76
+ } , { type : ContentType . Json } )
76
77
. then ( ( res ) => {
77
78
setAddSending ( false ) ;
78
79
setNewServiceAccount ( {
@@ -146,6 +147,7 @@ const AddServiceAccount = () => {
146
147
noValidate
147
148
autoComplete = "off"
148
149
onSubmit = { ( e : React . FormEvent < HTMLFormElement > ) => {
150
+ e . preventDefault ( ) ;
149
151
addServiceAccount ( e ) ;
150
152
} }
151
153
>
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ const AddReplicationModal = ({
183
183
} )
184
184
. catch ( ( err ) => {
185
185
setAddLoading ( false ) ;
186
- dispatch ( setModalErrorSnackMessage ( errorToHandler ( err ) ) ) ;
186
+ dispatch ( setModalErrorSnackMessage ( errorToHandler ( err . error ) ) ) ;
187
187
} ) ;
188
188
} ;
189
189
You can’t perform that action at this time.
0 commit comments