revert to previous invocation from KN clients to pick up changes fron db
This commit is contained in:
parent
98c9c3e0ff
commit
e0ea583aa6
4 changed files with 16 additions and 17 deletions
|
@ -39,8 +39,13 @@ class PeopleInSpaceRepository() : KoinComponent {
|
|||
}
|
||||
}
|
||||
|
||||
@Throws(Exception::class)
|
||||
suspend fun fetchPeople() = peopleInSpaceApi.fetchPeople().people
|
||||
fun fetchPeople(success: (List<Assignment>) -> Unit) {
|
||||
GlobalScope.launch(Dispatchers.Main) {
|
||||
fetchPeopleAsFlow()?.collect {
|
||||
success(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Throws(Exception::class)
|
||||
suspend fun fetchISSPosition() = peopleInSpaceApi.fetchISSPosition().iss_position
|
||||
|
|
|
@ -11,11 +11,9 @@ class PeopleInSpaceViewModel: ObservableObject {
|
|||
}
|
||||
|
||||
func fetch() {
|
||||
repository.fetchPeople { (data, error) in
|
||||
if let people = data {
|
||||
self.people = people
|
||||
}
|
||||
}
|
||||
repository.fetchPeople(success: { data in
|
||||
self.people = data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,11 +12,9 @@ class PeopleInSpaceViewModel: ObservableObject {
|
|||
}
|
||||
|
||||
func fetchPeople() {
|
||||
repository.fetchPeople { (data, error) in
|
||||
if let people = data {
|
||||
self.people = people
|
||||
}
|
||||
}
|
||||
repository.fetchPeople(success: { data in
|
||||
self.people = data
|
||||
})
|
||||
}
|
||||
|
||||
func fetchISSPosition() {
|
||||
|
|
|
@ -10,11 +10,9 @@ class PeopleInSpaceViewModel: ObservableObject {
|
|||
}
|
||||
|
||||
func fetch() {
|
||||
repository.fetchPeople { (data, error) in
|
||||
if let people = data {
|
||||
self.people = people
|
||||
}
|
||||
}
|
||||
repository.fetchPeople(success: { data in
|
||||
self.people = data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue