Skip to content

Commit

Permalink
[SWP-2320] feat(api): Changed api for publishing articles from publisher
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlovicnemanja committed Nov 21, 2024
1 parent ea6a2df commit 89e907e
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[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 89e907e

Please sign in to comment.