commit
This commit is contained in:
parent
02b3e891a6
commit
b1e844c956
@ -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<Flight> = suspendCancellableCoroutine { continuation ->
|
||||
// val call = service.findFlights(from, to, departureDate)
|
||||
// call.enqueue(object: Callback<List<FlightRemote>> {
|
||||
// override fun onResponse(call: Call<List<FlightRemote>>, response: Response<List<FlightRemote>>) {
|
||||
// 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<List<FlightRemote>>, t: Throwable) {
|
||||
// continuation.resumeWithException(t)
|
||||
// }
|
||||
// })
|
||||
//
|
||||
// continuation.invokeOnCancellation {
|
||||
// call.cancel()
|
||||
// }
|
||||
// }
|
||||
|
||||
override suspend fun findFlights(
|
||||
from: String,
|
||||
to: String,
|
||||
|
@ -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("Бронирования")
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user