forked from github/wulkanowy-mirror
Fix invalid order of school announcements (#1689)
This commit is contained in:
parent
79b970256f
commit
c87085a226
@ -10,6 +10,6 @@ import javax.inject.Singleton
|
||||
@Singleton
|
||||
interface SchoolAnnouncementDao : BaseDao<SchoolAnnouncement> {
|
||||
|
||||
@Query("SELECT * FROM SchoolAnnouncements WHERE student_id = :studentId")
|
||||
@Query("SELECT * FROM SchoolAnnouncements WHERE student_id = :studentId ORDER BY date DESC")
|
||||
fun loadAll(studentId: Int): Flow<List<SchoolAnnouncement>>
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ class SchoolAnnouncementPresenter @Inject constructor(
|
||||
Status.SUCCESS -> {
|
||||
Timber.i("Loading School announcement result: Success")
|
||||
view?.apply {
|
||||
updateData(it.data!!.sortedByDescending { item -> item.date })
|
||||
updateData(it.data!!)
|
||||
showEmpty(it.data.isEmpty())
|
||||
showErrorView(false)
|
||||
showContent(it.data.isNotEmpty())
|
||||
|
Loading…
x
Reference in New Issue
Block a user