forked from github/szkolny
[API/Szkolny] Fix respecting registration status of profile in App Sync.
This commit is contained in:
parent
a86e995113
commit
62d82c88a1
@ -6,15 +6,16 @@ package pl.szczodrzynski.edziennik.data.api.szkolny
|
||||
|
||||
import pl.szczodrzynski.edziennik.App
|
||||
import pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikCallback
|
||||
import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull
|
||||
import pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata
|
||||
import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile
|
||||
import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull
|
||||
|
||||
class Szkolny(val app: App, val callback: EdziennikCallback) {
|
||||
|
||||
private val api = SzkolnyApi(app)
|
||||
|
||||
fun sync(profiles: List<ProfileFull>) {
|
||||
fun sync(profileList: List<ProfileFull>) {
|
||||
val profiles = profileList.filter { it.registration == Profile.REGISTRATION_ENABLED }
|
||||
if (profiles.isNotEmpty()) {
|
||||
val events = api.getEvents(profiles)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user