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

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 { initializer {
FindFlightsViewModel( FindFlightsViewModel(
this.createSavedStateHandle(), this.createSavedStateHandle(),
ticketApplication().container.flightRestRepository, ticketApplication().container.flightRestRepository)
ticketApplication().container.appService
)
} }
initializer { initializer {
UserEditViewModel( UserEditViewModel(

View File

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