Skip to content

Commit

Permalink
fix: adapt AssociationUtils to callback
Browse files Browse the repository at this point in the history
  • Loading branch information
zizouet committed Apr 10, 2024
1 parent 9065e03 commit f3cf2c7
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class AssociationUtils(
}

fun update() {
if (assocId != "") _associationState = associationDatabase.getAssociation(assocId)
if (assocId != "") associationDatabase.getAssociation(assocId){ assoc -> _associationState = assoc }
}

fun getAssocId(): String {
Expand Down Expand Up @@ -131,7 +131,10 @@ class AssociationUtils(

fun getAllAssociations(): List<Association> {
if (_associationState == null) return emptyList()
return associationDatabase.getAssociations()
var result : List<Association>? = null
associationDatabase.getAssociations(){associations -> result = associations}

return result!!
}

fun getFilteredAssociations(searchQuery: String): List<Association> {
Expand Down

0 comments on commit f3cf2c7

Please sign in to comment.