Skip to content

Commit

Permalink
Merge pull request #359 from superdesk/SWP-2320
Browse files Browse the repository at this point in the history
Custom content push endpoint for non published articles in content lists
  • Loading branch information
IvanJelicSF authored Nov 21, 2024
2 parents bffe311 + 936c4fe commit 3817855
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions client/components/ContentLists/Manual/Manual.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,8 @@ class Manual extends React.Component {
format_type: "NINJSFormatter"
},
}).then((response) => {
const ninjs = this.props.publisher.publishSuperdeskArticle(response.export[item_id]).then(() => {
this.props.publisher.getArticleByCode(item_id).then((res) => {
resolve(res);
});
const ninjs = this.props.publisher.publishSuperdeskArticle('new', response.export[item_id]).then((response) => {
resolve(response.article_ids[0]);
});
});
});
Expand Down Expand Up @@ -516,8 +514,8 @@ class Manual extends React.Component {
return itemId === item_id;
});

change.content_id = res.id;
list.items[index].id = res.id;
change.content_id = res;
list.items[index].id = res;
}
return change;
});
Expand Down
4 changes: 2 additions & 2 deletions client/services/PublisherFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ export function PublisherFactory(pubapi) {
* @returns {Promise}
* @description push article to publsiher
*/
publishSuperdeskArticle(article) {
return pubapi.publish("content/push", article);
publishSuperdeskArticle(status, article) {
return pubapi.publish(`content/push-with-options?status=${status}`, article);
}

/**
Expand Down

0 comments on commit 3817855

Please sign in to comment.