mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-10 17:33:24 +01:00
Fix error parsing bug on return
This commit is contained in:
parent
8df40788ba
commit
eeceb9734a
@ -5,6 +5,7 @@
|
||||
"scripts": {
|
||||
"start": "webpack serve",
|
||||
"build": "webpack --mode production",
|
||||
"build-dev": "webpack --mode development",
|
||||
"lint": "eslint src",
|
||||
"extract": "formatjs extract",
|
||||
"compile": "formatjs compile"
|
||||
|
@ -46,20 +46,18 @@ export const parseResponseOnError = (response: any): ErrorInfo => {
|
||||
break;
|
||||
default:
|
||||
if (data) {
|
||||
result = {};
|
||||
// Set global errors ...
|
||||
if (data.globalErrors) {
|
||||
let msg;
|
||||
let msg:string;
|
||||
let errors = data.globalErrors;
|
||||
if (errors.length > 0) {
|
||||
msg = errors[0];
|
||||
result.msg = errors[0];
|
||||
}
|
||||
result = { msg: errors };
|
||||
}
|
||||
|
||||
// Set field errors ...
|
||||
if (data.fieldErrors) {
|
||||
// @Todo: Fix this ...
|
||||
result = { msg: data.fieldErrors };
|
||||
result.fields = new Map<string, string>();
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,8 @@ import { Alert } from "@material-ui/lab";
|
||||
export const StyledAlert = withStyles({
|
||||
root:
|
||||
{
|
||||
padding: '10px 0px 10px 0px'
|
||||
padding: '10px 15px',
|
||||
margin: '5px 0px '
|
||||
}
|
||||
})(Alert);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user