mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-31 05:48:19 +01:00
[API/Librus] Fix announcement mark as read request and fix observer in announcements.
This commit is contained in:
parent
5e2c7e89ab
commit
a86e995113
@ -5,6 +5,7 @@
|
||||
package pl.szczodrzynski.edziennik.data.api.edziennik.librus.data.api
|
||||
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import pl.szczodrzynski.edziennik.data.api.POST
|
||||
import pl.szczodrzynski.edziennik.data.api.edziennik.librus.DataLibrus
|
||||
import pl.szczodrzynski.edziennik.data.api.edziennik.librus.data.LibrusApi
|
||||
import pl.szczodrzynski.edziennik.data.api.events.AnnouncementGetEvent
|
||||
@ -21,7 +22,7 @@ class LibrusApiAnnouncementMarkAsRead(
|
||||
}
|
||||
|
||||
init {
|
||||
apiGet(TAG, "SchoolNotices/MarkAsRead/${announcement.idString}") {
|
||||
apiGet(TAG, "SchoolNotices/MarkAsRead/${announcement.idString}", method = POST) {
|
||||
announcement.seen = true
|
||||
|
||||
EventBus.getDefault().postSticky(AnnouncementGetEvent(announcement))
|
||||
|
@ -29,7 +29,7 @@ public abstract class AnnouncementDao {
|
||||
@Query("DELETE FROM announcements WHERE profileId = :profileId")
|
||||
public abstract void clear(int profileId);
|
||||
|
||||
@RawQuery(observedEntities = {Announcement.class})
|
||||
@RawQuery(observedEntities = {Announcement.class, Metadata.class})
|
||||
abstract LiveData<List<AnnouncementFull>> getAll(SupportSQLiteQuery query);
|
||||
public LiveData<List<AnnouncementFull>> getAll(int profileId, String filter) {
|
||||
return getAll(new SimpleSQLiteQuery("SELECT \n" +
|
||||
|
Loading…
x
Reference in New Issue
Block a user