fix response handling
This commit is contained in:
1 parent
d2048ea5b7
commit
cf500a75d1
3 files changed
+11
-2
No files matched your search
@@ -68,7 +68,7 @@ class AnyTypeApi(
|
|||||||
bearerAuth(apiKey)
|
bearerAuth(apiKey)
|
||||||
setBody(CreateObjectRequest(name = title, body = details, typeKey = "ot-task"))
|
setBody(CreateObjectRequest(name = title, body = details, typeKey = "ot-task"))
|
||||||
}
|
}
|
||||||
response.body<CreateObjectResponse>().objectId
|
response.body<CreateObjectResponse>().obj.id
|
||||||
}
|
}
|
||||||
|
|
||||||
fun close() = http.close()
|
fun close() = http.close()
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
package ch.ergon.anytask.api.dto
|
package ch.ergon.anytask.api.dto
|
||||||
|
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class CreateObjectResponse(
|
data class CreateObjectResponse(
|
||||||
val objectId: String,
|
@SerialName("object") val obj: CreatedObject,
|
||||||
)
|
)
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package ch.ergon.anytask.api.dto
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class CreatedObject(
|
||||||
|
val id: String,
|
||||||
|
)
|
||||||