загрузила отчеты

This commit is contained in:
Татьяна Артамонова 2023-12-23 11:55:48 +04:00
parent 03c16aacd7
commit f67c6d76be
7 changed files with 9 additions and 11 deletions

View File

@ -53,9 +53,7 @@ object AppViewModelProvider {
initializer {
FindFlightsViewModel(
this.createSavedStateHandle(),
ticketApplication().container.flightRestRepository,
ticketApplication().container.appService
)
ticketApplication().container.flightRestRepository)
}
initializer {
UserEditViewModel(

View File

@ -25,22 +25,22 @@ class FindFlightsViewModel(
private val from: String = checkNotNull(savedStateHandle["direction_from"])
private val to: String = checkNotNull(savedStateHandle["direction_to"])
private val departureDate: String = checkNotNull(savedStateHandle["departure_date"])
private val appService: AppService
get() {
return AppService
}
// private val appService: AppService
// get() {
// return AppService
// }
var foundFlightsList: List<Flight> by mutableStateOf(emptyList())
private set
// var foundFlightsUiState by mutableStateOf(FoundFlightsUiState())
// private set
var foundFlightsUiState by mutableStateOf(FoundFlightsUiState())
private set
init {
viewModelScope.launch {
foundFlightsList = appService.foundFlights().map { it.toFlight() }
//foundFlightsUiState = FoundFlightsUiState(flightRepository.foundFlights(from, to, departureDate))
//foundFlightsList = appService.foundFlights().map { it.toFlight() }
foundFlightsUiState = FoundFlightsUiState(flightRepository.foundFlights(from, to, departureDate))
}
}
}