mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-18 21:06:44 -06:00
[API/Librus] Fix marking removed announcements as read.
This commit is contained in:
parent
4717b4549e
commit
448fd0e884
@ -116,6 +116,7 @@ const val ERROR_LOGIN_LIBRUS_MESSAGES_INVALID_LOGIN = 179
|
||||
const val ERROR_LOGIN_LIBRUS_PORTAL_INVALID_LOGIN = 180
|
||||
const val ERROR_LIBRUS_API_MAINTENANCE = 181
|
||||
const val ERROR_LIBRUS_PORTAL_MAINTENANCE = 182
|
||||
const val ERROR_LIBRUS_API_NOTICEBOARD_PROBLEM = 183
|
||||
|
||||
const val ERROR_LOGIN_MOBIDZIENNIK_WEB_INVALID_LOGIN = 201
|
||||
const val ERROR_LOGIN_MOBIDZIENNIK_WEB_OLD_PASSWORD = 202
|
||||
|
@ -63,6 +63,7 @@ open class LibrusApi(open val data: DataLibrus) {
|
||||
"NotesIsNotActive" -> ERROR_LIBRUS_API_NOTES_NOT_ACTIVE
|
||||
"InvalidRequest" -> ERROR_LIBRUS_API_INVALID_REQUEST_PARAMS
|
||||
"Nieprawidłowy węzeł." -> ERROR_LIBRUS_API_INCORRECT_ENDPOINT
|
||||
"NoticeboardProblem" -> ERROR_LIBRUS_API_NOTICEBOARD_PROBLEM
|
||||
else -> ERROR_LIBRUS_API_OTHER
|
||||
}.let { errorCode ->
|
||||
if (errorCode !in ignoreErrors) {
|
||||
|
@ -6,12 +6,13 @@ package pl.szczodrzynski.edziennik.data.api.edziennik.librus.data.api
|
||||
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import pl.szczodrzynski.edziennik.data.api.ERROR_LIBRUS_API_INVALID_REQUEST_PARAMS
|
||||
import pl.szczodrzynski.edziennik.data.api.ERROR_LIBRUS_API_NOTICEBOARD_PROBLEM
|
||||
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
|
||||
import pl.szczodrzynski.edziennik.data.db.full.AnnouncementFull
|
||||
import pl.szczodrzynski.edziennik.data.db.entity.Metadata
|
||||
import pl.szczodrzynski.edziennik.data.db.full.AnnouncementFull
|
||||
|
||||
class LibrusApiAnnouncementMarkAsRead(
|
||||
override val data: DataLibrus,
|
||||
@ -24,7 +25,10 @@ class LibrusApiAnnouncementMarkAsRead(
|
||||
|
||||
init {
|
||||
apiGet(TAG, "SchoolNotices/MarkAsRead/${announcement.idString}", method = POST,
|
||||
ignoreErrors = listOf(ERROR_LIBRUS_API_INVALID_REQUEST_PARAMS)) {
|
||||
ignoreErrors = listOf(
|
||||
ERROR_LIBRUS_API_INVALID_REQUEST_PARAMS,
|
||||
ERROR_LIBRUS_API_NOTICEBOARD_PROBLEM
|
||||
)) {
|
||||
announcement.seen = true
|
||||
|
||||
EventBus.getDefault().postSticky(AnnouncementGetEvent(announcement))
|
||||
|
@ -90,6 +90,7 @@
|
||||
<string name="error_180" translatable="false">ERROR_LOGIN_LIBRUS_PORTAL_INVALID_LOGIN</string>
|
||||
<string name="error_181" translatable="false">ERROR_LIBRUS_API_MAINTENANCE</string>
|
||||
<string name="error_182" translatable="false">ERROR_LIBRUS_PORTAL_MAINTENANCE</string>
|
||||
<string name="error_183" translatable="false">ERROR_LIBRUS_API_NOTICEBOARD_PROBLEM</string>
|
||||
|
||||
<string name="error_201" translatable="false">ERROR_LOGIN_MOBIDZIENNIK_WEB_INVALID_LOGIN</string>
|
||||
<string name="error_202" translatable="false">ERROR_LOGIN_MOBIDZIENNIK_WEB_OLD_PASSWORD</string>
|
||||
@ -256,6 +257,7 @@
|
||||
<string name="error_180_reason">Librus Portal: nieprawidłowe dane logowania</string>
|
||||
<string name="error_181_reason">Librus API: przerwa techniczna</string>
|
||||
<string name="error_182_reason">Librus Portal: przerwa techniczna</string>
|
||||
<string name="error_183_reason">Wystąpił problem z tablicą ogłoszeń</string>
|
||||
|
||||
<string name="error_201_reason">Nieprawidłowy login lub hasło</string>
|
||||
<string name="error_202_reason">Podano stare hasło</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user