Skip to content

Commit

Permalink
Fix dining preference serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
meiron03 committed Aug 31, 2024
1 parent 20d150c commit a8ff906
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.google.gson.annotations.Expose
import com.google.gson.annotations.SerializedName

class DiningHallPreference {
@SerializedName("venueId")
@SerializedName("venue_id")
@Expose
val id: Int? = null
}
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,12 @@ class HomepageViewModel : HomepageDataModel, ViewModel() {
studentLife.getDiningPreferences(bearerToken).subscribe({ preferences ->
val list = preferences.preferences
val venues = mutableListOf<Int>()
if (list?.isEmpty() == true) {
if (list.isNullOrEmpty()) {
venues.add(593)
venues.add(1442)
venues.add(636)
} else {
list?.forEach {
list.forEach {
it.id?.let { it1 -> venues.add(it1) }
}
}
Expand Down

0 comments on commit a8ff906

Please sign in to comment.