ExposedPostsRepo now using post also as RegisteredContent (if is)
This commit is contained in:
core
api
src
commonMain
kotlin
com
insanusmokrassar
postssystem
core
post
exposed
src
main
kotlin
com
insanusmokrassar
postssystem
core
exposed
publishing/api/src/commonMain/kotlin/com/insanusmokrassar/postssystem/core/publishing
@ -31,12 +31,14 @@ class BusinessPublishingTrigger(
|
||||
publishingKeysRepo.unsetPostTriggerControlKey(postId)
|
||||
|
||||
return postsRepo.getPostById(postId) ?.let { post ->
|
||||
if (postsRepo.deletePost(postId)) {
|
||||
publishedPostsRepo.createPost(post)
|
||||
postingTriggeredChannel.send(post)
|
||||
postId
|
||||
} else {
|
||||
null
|
||||
publishedPostsRepo.createPost(post) ?.let { publishedPost ->
|
||||
if (postsRepo.deletePost(postId)) {
|
||||
postingTriggeredChannel.send(post)
|
||||
postId
|
||||
} else {
|
||||
publishedPostsRepo.deletePost(publishedPost.id)
|
||||
null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user