Commit b8bf497c authored by Bjørnar Østtveit's avatar Bjørnar Østtveit

Fixed a small error when editing an existing article

parent c2c47e3f
Pipeline #26417 passed with stage
in 4 minutes and 33 seconds
......@@ -237,8 +237,9 @@ class EditorRoute extends Component<{ match: { params: { category: string, artic
submit(article: Object, callback: () => mixed) {
if (this.exists) {
articleService.updateArticle(parseInt(this.props.match.params.article_id), article).then((res) => {
let path: string = (this.categories.find((e) => e.category_id == article.category_id): any).path;
if (res['result'] == 'success') {
history.push('/' + this.props.match.params.category + '/' + this.props.match.params.article_id);
history.push('/' + path + '/' + this.props.match.params.article_id);
} else {
callback();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment