Rely on default modal error handling

This also gives the server-side the chance to add more different error
messages / additional behavior without having to change the frontend.

Refs .
This commit is contained in:
Franz Liedke 2020-02-07 11:55:00 +01:00
parent e9a11b11d3
commit 95d2ba3eb7

@ -112,12 +112,4 @@ export default class FlagPostModal extends Modal {
.catch(() => {})
.then(this.loaded.bind(this));
}
onerror(error) {
if (error.status === 422) {
error.alert.props.children = app.translator.trans('flarum-flags.forum.flag_post.reason-needed');
}
super.onerror(error);
}
}