Fix media type for validation error

This commit is contained in:
René Pfeuffer
2019-03-04 08:44:41 +01:00
parent 8e9df1ce34
commit dadfe4a8af
3 changed files with 25 additions and 16 deletions

View File

@@ -46,18 +46,7 @@ class BackendErrorNotification extends React.Component<Props> {
const { error, t } = this.props;
return (
<>
<p>
<strong>{t("errors.context")}</strong>
</p>
<ul>
{error.context.map((context, index) => {
return (
<li key={index}>
<strong>{context.type}:</strong> {context.id}
</li>
);
})}
</ul>
{this.renderContext(error)}
{this.renderMoreInformationLink(error)}
<div className="level is-size-7">
<div className="left">
@@ -71,6 +60,26 @@ class BackendErrorNotification extends React.Component<Props> {
);
};
renderContext = (error: BackendError) => {
if (error.context) {
return <>
<p>
<strong>{t("errors.context")}</strong>
</p>
<ul>
{error.context.map((context, index) => {
return (
<li key={index}>
<strong>{context.type}:</strong> {context.id}
</li>
);
})}
</ul>
</>;
}
};
renderMoreInformationLink = (error: BackendError) => {
const { t } = this.props;
if (error.url) {