Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Commit 63f7432

Browse files
committed
* Fixed Book/Reader send return status
1 parent 9eabb55 commit 63f7432

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/kotlin/Main.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fun main() {
3333
}
3434

3535
override fun onResponse(call: Call, response: Response) {
36-
if (response.code == 200)
36+
if (response.isSuccessful)
3737
println("Book added successfully")
3838
else
3939
println("Failed to add book (Status code: ${response.code})")
@@ -50,7 +50,10 @@ fun main() {
5050
}
5151

5252
override fun onResponse(call: Call, response: Response) {
53-
println("Reader added successfully")
53+
if(response.isSuccessful)
54+
println("Reader added successfully")
55+
else
56+
println("Failed to add reader (Status code: ${response.code})")
5457
}
5558
})
5659
}

0 commit comments

Comments
 (0)