Sort the list alphabetticaly for bin search

This commit is contained in:
Joren
2024-04-30 01:52:35 +02:00
parent 0ebf26c457
commit fd122ec376

View File

@@ -29,7 +29,7 @@ class PokeSearchViewModel(private val favouritesRepository: FavouritesRepository
viewModelScope.launch { viewModelScope.launch {
try { try {
val response = service.getPokemon() val response = service.getPokemon()
_initialPokemonList.value = response.results _initialPokemonList.value = response.results.sortedBy { it.name.lowercase() }
} catch (e: IOException) { } catch (e: IOException) {
/*TODO*/ /*TODO*/
} }