fix: implement robust PHONE device fallback in handleDashboardAction for local development
This commit is contained in:
@@ -166,10 +166,11 @@ class MeatbagClient(
|
||||
|
||||
suspend fun respond(response: ApprovalResponse): Boolean {
|
||||
return try {
|
||||
log("Sending response to POST http://$host:$port/api/respond : ${response.toJson()}")
|
||||
val responseWithDevice = response.copy(deviceId = deviceId)
|
||||
log("Sending response to POST http://$host:$port/api/respond : ${responseWithDevice.toJson()}")
|
||||
val httpResponse = client.post("http://$host:$port/api/respond") {
|
||||
contentType(ContentType.Application.Json)
|
||||
setBody(response)
|
||||
setBody(responseWithDevice)
|
||||
}
|
||||
if (httpResponse.status.isSuccess()) {
|
||||
log("Response submitted successfully! Server returned 200 OK", LogType.SUCCESS)
|
||||
|
||||
Reference in New Issue
Block a user