From b1e844c956cbb3eb0c2c5327ed252eb1be4346ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=B0=D1=82=D1=8C=D1=8F=D0=BD=D0=B0=20=D0=90=D1=80?= =?UTF-8?q?=D1=82=D0=B0=D0=BC=D0=BE=D0=BD=D0=BE=D0=B2=D0=B0?= Date: Sat, 23 Dec 2023 09:24:08 +0400 Subject: [PATCH] commit --- .../api/repository/RestFlightRepository.kt | 27 --------------- .../is/airticketrentservice/screen/Admin.kt | 34 +++++++++---------- 2 files changed, 17 insertions(+), 44 deletions(-) diff --git a/app/src/main/java/ru/ulstu/is/airticketrentservice/api/repository/RestFlightRepository.kt b/app/src/main/java/ru/ulstu/is/airticketrentservice/api/repository/RestFlightRepository.kt index 634cabe..835559f 100644 --- a/app/src/main/java/ru/ulstu/is/airticketrentservice/api/repository/RestFlightRepository.kt +++ b/app/src/main/java/ru/ulstu/is/airticketrentservice/api/repository/RestFlightRepository.kt @@ -59,33 +59,6 @@ class RestFlightRepository( override suspend fun getFlightById(flightId: Int): Flight = service.getFlight(flightId).toFlight() -// override suspend fun findFlights( -// from: String, -// to: String, -// departureDate: String -// ): List = suspendCancellableCoroutine { continuation -> -// val call = service.findFlights(from, to, departureDate) -// call.enqueue(object: Callback> { -// override fun onResponse(call: Call>, response: Response>) { -// if (response.isSuccessful) { -// val flightRemoteList = response.body() ?: emptyList() -// val flightList = flightRemoteList.map { it.toFlight() } -// continuation.resume(flightList) -// } else { -// continuation.resumeWithException(Exception("Server error: ${response.code()}")) -// } -// } -// -// override fun onFailure(call: Call>, t: Throwable) { -// continuation.resumeWithException(t) -// } -// }) -// -// continuation.invokeOnCancellation { -// call.cancel() -// } -// } - override suspend fun findFlights( from: String, to: String, diff --git a/app/src/main/java/ru/ulstu/is/airticketrentservice/screen/Admin.kt b/app/src/main/java/ru/ulstu/is/airticketrentservice/screen/Admin.kt index a0dfeda..779a2d1 100644 --- a/app/src/main/java/ru/ulstu/is/airticketrentservice/screen/Admin.kt +++ b/app/src/main/java/ru/ulstu/is/airticketrentservice/screen/Admin.kt @@ -45,23 +45,6 @@ fun Admin ( ) { Text("Рейсы") } - Button( - onClick = { navController.navigate(BottomBarScreen.RentList.route)}, - colors = ButtonDefaults.buttonColors( - containerColor = (colorResource(id = R.color.lightBlue)), - contentColor = Color.White - ), - elevation = ButtonDefaults.buttonElevation( - defaultElevation = 10.dp, - pressedElevation = 6.dp - ), - shape = RoundedCornerShape(15.dp), - modifier = Modifier - .fillMaxWidth() - .padding(all = 10.dp), - ) { - Text("Бронирования") - } Button( onClick = { navController.navigate(BottomBarScreen.UserList.route)}, colors = ButtonDefaults.buttonColors( @@ -79,5 +62,22 @@ fun Admin ( ) { Text("Пользователи") } + Button( + onClick = { navController.navigate(BottomBarScreen.RentList.route)}, + colors = ButtonDefaults.buttonColors( + containerColor = (colorResource(id = R.color.lightBlue)), + contentColor = Color.White + ), + elevation = ButtonDefaults.buttonElevation( + defaultElevation = 10.dp, + pressedElevation = 6.dp + ), + shape = RoundedCornerShape(15.dp), + modifier = Modifier + .fillMaxWidth() + .padding(all = 10.dp), + ) { + Text("Бронирования") + } } } \ No newline at end of file