make triggerId optinal in create post case
This commit is contained in:
@@ -8,14 +8,13 @@ import com.insanusmokrassar.postssystem.ktor.buildStandardUrl
|
||||
import com.insanusmokrassar.postssystem.ktor.client.BodyPair
|
||||
import com.insanusmokrassar.postssystem.ktor.client.unipost
|
||||
import io.ktor.client.HttpClient
|
||||
import io.ktor.client.request.post
|
||||
|
||||
class PostCreatingClientCase(
|
||||
private val baseUrl: String,
|
||||
private val client: HttpClient
|
||||
) : PostCreatingCase {
|
||||
private val realBaseUrl = "$baseUrl/$postCreatingRootRoute"
|
||||
override suspend fun createPost(postContent: List<Content>, triggerId: TriggerId): RegisteredPost? = client.unipost(
|
||||
override suspend fun createPost(postContent: List<Content>, triggerId: TriggerId?): RegisteredPost? = client.unipost(
|
||||
buildStandardUrl(realBaseUrl, postCreatingCreatePostRoute),
|
||||
BodyPair(PostCreatingCreatePostModel.serializer(), PostCreatingCreatePostModel(postContent, triggerId)),
|
||||
RegisteredPost.serializer()
|
||||
|
Reference in New Issue
Block a user