forked from github/szkolny
[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
|
package pl.szczodrzynski.edziennik.data.api.edziennik.librus.data.api
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus
|
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.DataLibrus
|
||||||
import pl.szczodrzynski.edziennik.data.api.edziennik.librus.data.LibrusApi
|
import pl.szczodrzynski.edziennik.data.api.edziennik.librus.data.LibrusApi
|
||||||
import pl.szczodrzynski.edziennik.data.api.events.AnnouncementGetEvent
|
import pl.szczodrzynski.edziennik.data.api.events.AnnouncementGetEvent
|
||||||
@ -21,7 +22,7 @@ class LibrusApiAnnouncementMarkAsRead(
|
|||||||
}
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
apiGet(TAG, "SchoolNotices/MarkAsRead/${announcement.idString}") {
|
apiGet(TAG, "SchoolNotices/MarkAsRead/${announcement.idString}", method = POST) {
|
||||||
announcement.seen = true
|
announcement.seen = true
|
||||||
|
|
||||||
EventBus.getDefault().postSticky(AnnouncementGetEvent(announcement))
|
EventBus.getDefault().postSticky(AnnouncementGetEvent(announcement))
|
||||||
|
@ -29,7 +29,7 @@ public abstract class AnnouncementDao {
|
|||||||
@Query("DELETE FROM announcements WHERE profileId = :profileId")
|
@Query("DELETE FROM announcements WHERE profileId = :profileId")
|
||||||
public abstract void clear(int profileId);
|
public abstract void clear(int profileId);
|
||||||
|
|
||||||
@RawQuery(observedEntities = {Announcement.class})
|
@RawQuery(observedEntities = {Announcement.class, Metadata.class})
|
||||||
abstract LiveData<List<AnnouncementFull>> getAll(SupportSQLiteQuery query);
|
abstract LiveData<List<AnnouncementFull>> getAll(SupportSQLiteQuery query);
|
||||||
public LiveData<List<AnnouncementFull>> getAll(int profileId, String filter) {
|
public LiveData<List<AnnouncementFull>> getAll(int profileId, String filter) {
|
||||||
return getAll(new SimpleSQLiteQuery("SELECT \n" +
|
return getAll(new SimpleSQLiteQuery("SELECT \n" +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user