diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/events/task/ServerSyncTask.kt b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/events/task/ServerSyncTask.kt index 49ded1dc..276971b6 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/events/task/ServerSyncTask.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/events/task/ServerSyncTask.kt @@ -21,9 +21,9 @@ class ServerSyncTask : IApiTask(-1) { } fun run(app: App, profiles: List, taskCallback: EdziennikCallback) { - val api = SzkolnyApi(app, profiles) + val api = SzkolnyApi(app) - val events = api.getEvents() + val events = api.getEvents(profiles) if (events.isNotEmpty()) { app.db.eventDao().addAll(events) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/szkolny/SzkolnyApi.kt b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/szkolny/SzkolnyApi.kt index e583c36a..8d65586b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/szkolny/SzkolnyApi.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/szkolny/SzkolnyApi.kt @@ -22,7 +22,7 @@ import retrofit2.converter.gson.GsonConverterFactory import retrofit2.create import java.util.concurrent.TimeUnit.SECONDS -class SzkolnyApi(val app: App, val profiles: List) { +class SzkolnyApi(val app: App) { private var api: SzkolnyService @@ -49,7 +49,7 @@ class SzkolnyApi(val app: App, val profiles: List) { api = retrofit.create() } - fun getEvents(): List { + fun getEvents(profiles: List): List { val teams = app.db.teamDao().allNow val response = api.serverSync(ServerSyncRequest(