From 0a3e1e2cf33262ab33551e8f14d11fdb3e5cd615 Mon Sep 17 00:00:00 2001 From: LeightonGinty Date: Sun, 17 Nov 2024 11:45:50 +0000 Subject: Design changes --- app/src/main/java/com/example/alcagotchi/AlcoGotchi.kt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'app/src/main/java/com/example/alcagotchi/AlcoGotchi.kt') diff --git a/app/src/main/java/com/example/alcagotchi/AlcoGotchi.kt b/app/src/main/java/com/example/alcagotchi/AlcoGotchi.kt index 42536f5..a101f6c 100644 --- a/app/src/main/java/com/example/alcagotchi/AlcoGotchi.kt +++ b/app/src/main/java/com/example/alcagotchi/AlcoGotchi.kt @@ -115,9 +115,8 @@ class AlcoGotchi private constructor() { handleStateResponse(client.newCall(request).execute()) } } - suspend fun postDrive() { + suspend fun getDrive() { val body = JSONObject() -// body.put("drive", drink) val request = Request.Builder() .url(buildUrl("drive")) @@ -128,4 +127,15 @@ class AlcoGotchi private constructor() { handleStateResponse(client.newCall(request).execute()) } } + suspend fun getClub() { + val body = JSONObject() + val request = Request.Builder() + .url(buildUrl("club")) + .get() + .build() + + return withContext(Dispatchers.IO) { + handleStateResponse(client.newCall(request).execute()) + } + } } -- cgit v1.2.3-70-g09d2