Skip to content

Commit

Permalink
fix(lists): Fixed issue when lists are not updated on error
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlovicnemanja committed Dec 20, 2024
1 parent 1df1d46 commit a638e0e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/components/ContentLists/Manual/Manual.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ class Manual extends React.Component {
return reject(error);
}
});
});
}, (error) => reject(error));
});
}

Expand All @@ -346,7 +346,7 @@ class Manual extends React.Component {
}

try {
const article = await this.props.publisher.getArticleByCode(code);
const article = await this.props.publisher.getArticleByCode(code + '123');
if (article) {
console.warn('Article added to the content list successfully.', article);
return article.id;
Expand Down Expand Up @@ -499,6 +499,7 @@ class Manual extends React.Component {
let list = { ...this.state.list };
let originalList = { ...this.state.list };
let originalArticles = { ...this.state.articles };
let originalChangesRecord = [...this.state.changesRecord];

if (source.droppableId === destination.droppableId) {
let items = reorder(
Expand Down Expand Up @@ -558,6 +559,7 @@ class Manual extends React.Component {
this.setState({
list: originalList,
articles: originalArticles,
changesRecord: originalChangesRecord
});

list.loading = false;
Expand Down

0 comments on commit a638e0e

Please sign in to comment.