|
|
|
@ -140,7 +140,6 @@ class PostService extends SiteService {
|
|
|
|
|
updateOp.$set['flags.isFeatured'] = postDefinition.isFeatured === 'on';
|
|
|
|
|
|
|
|
|
|
const OLD_STATUS = post.status;
|
|
|
|
|
|
|
|
|
|
const postAuthor = post.author;
|
|
|
|
|
|
|
|
|
|
post = await Post.findOneAndUpdate(
|
|
|
|
@ -155,16 +154,15 @@ class PostService extends SiteService {
|
|
|
|
|
if ((OLD_STATUS === 'draft') && (updateOp.$set.status === 'published')) {
|
|
|
|
|
const event = {
|
|
|
|
|
action: 'post-create',
|
|
|
|
|
emitter: postAuthor,
|
|
|
|
|
label: updateOp.$set.title,
|
|
|
|
|
content: updateOp.$set.summary,
|
|
|
|
|
href: `${CORE_SCHEME}://${site.domain}/post/${updateOp.$set.slug}`,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (post.image) {
|
|
|
|
|
event.thumbnail = `${CORE_SCHEME}://${site.domain}/image/${post.image}`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await coreNodeService.sendKaleidoscopeEvent(postAuthor, event);
|
|
|
|
|
await coreNodeService.sendKaleidoscopeEvent(event);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|