Bugfix
This commit is contained in:
parent
1cb797f307
commit
2f701982fe
@ -60,11 +60,12 @@ class UserRepository(
|
|||||||
}
|
}
|
||||||
suspend fun openDoor(token: String, code: String): Result<Int> = withContext(Dispatchers.IO){
|
suspend fun openDoor(token: String, code: String): Result<Int> = withContext(Dispatchers.IO){
|
||||||
runCatching{
|
runCatching{
|
||||||
val result = Network.client.post("$serverUrl/api/opendoor") {
|
val result = Network.client.post("$serverUrl/api/acs/open") {
|
||||||
headers {
|
headers {
|
||||||
append(HttpHeaders.Authorization, "Bearer $token")
|
append(HttpHeaders.Authorization, "Bearer $token")
|
||||||
}
|
}
|
||||||
setBody("""{ "code": "$code" }""")
|
contentType(ContentType.Application.Json)
|
||||||
|
setBody(code)
|
||||||
}
|
}
|
||||||
if (result.status != HttpStatusCode.OK) {
|
if (result.status != HttpStatusCode.OK) {
|
||||||
error("Status ${result.status}: ${result.body<String>()}")
|
error("Status ${result.status}: ${result.body<String>()}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user