Remove error from http response

This commit is contained in:
Klaus Klein 2017-06-08 14:29:35 -03:00
parent e7e1243fef
commit 68f52aa107
2 changed files with 5 additions and 3 deletions

View File

@ -51,7 +51,10 @@ class IntlStartup extends Component {
return response.json();
})
.then((messages) => {
this.setState({ messages }, () => {
if (messages.statusCode === 506) {
this.setState({ appLocale: 'en' });
}
this.setState({ messages: messages.messages }, () => {
baseControls.updateLoadingState(false);
});
})

View File

@ -43,8 +43,7 @@ WebApp.connectHandlers.use('/locale', (req, res) => {
});
res.setHeader('Content-Type', 'application/json');
res.writeHead(statusCode);
res.end(JSON.stringify(messages));
res.end(JSON.stringify({ statusCode, messages }));
});
WebApp.connectHandlers.use('/locales', (req, res) => {