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