From 5b4fdcc6d9e2da74de8e492ce8a37d0008d31be4 Mon Sep 17 00:00:00 2001 From: Puvikaran Santhirasegaram <74664443+Puvikaran2001@users.noreply.github.com> Date: Thu, 16 May 2024 10:33:03 +0200 Subject: [PATCH] Delete ApiButton.kt --- .../schedulingfrontend/pages/ApiButton.kt | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/ApiButton.kt diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/ApiButton.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/ApiButton.kt deleted file mode 100644 index 0002e923..00000000 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/ApiButton.kt +++ /dev/null @@ -1,38 +0,0 @@ -package dk.scheduling.schedulingfrontend.pages - -import android.util.Log -import androidx.compose.material3.Button -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.runtime.rememberCoroutineScope -import dk.scheduling.schedulingfrontend.api.getApiClient -import kotlinx.coroutines.launch - -@Composable -fun ApiButton() { - val coroutineScope = rememberCoroutineScope() - val apiService = getApiClient("http://10.0.2.2:2222") - - Button(onClick = { - coroutineScope.launch { - try { - val response = apiService.getAllTasks("NOT_VALID") - - if (response.isSuccessful) { - // val post = response.body() - Log.i("testAPI", "we got a response") - // Handle the retrieved post data - } else { - Log.w("testAPI", "we did not get a successful response") - Log.w("testAPI", response.message()) - // Handle error - } - } catch (e: Exception) { - Log.e("testApi", e.toString()) - throw e - } - } - }) { - Text("Test API") - } -}