Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fake data for sponsors, contributors, and staff #185

Merged
merged 6 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
// FIXME: When the API is ready, remove Suppress annotation below.
@file:Suppress("UnusedPrivateProperty", "UnusedPrivateMember")

package io.github.droidkaigi.confsched.data.contributors

import de.jensklingenberg.ktorfit.Ktorfit
import de.jensklingenberg.ktorfit.http.GET
import io.github.droidkaigi.confsched.data.NetworkService
import io.github.droidkaigi.confsched.data.contributors.response.ContributorsResponse
import io.github.droidkaigi.confsched.model.Contributor
import io.github.droidkaigi.confsched.model.fakes
import kotlinx.collections.immutable.PersistentList
import kotlinx.collections.immutable.toPersistentList

Expand All @@ -20,9 +24,11 @@ public class DefaultContributorsApiClient(

private val contributorApi = ktorfit.create<ContributorApi>()
public override suspend fun contributors(): PersistentList<Contributor> {
return networkService {
contributorApi.getContributors()
}.toContributorList()
// FIXME: When the API is ready, remove the comments below and return the actual data.
return Contributor.fakes()
// return networkService {
// contributorApi.getContributors()
// }.toContributorList()
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// FIXME: When the API is ready, remove Suppress annotation below.
@file:Suppress("UnusedPrivateProperty", "UnusedPrivateMember")

package io.github.droidkaigi.confsched.data.sponsors

import de.jensklingenberg.ktorfit.Ktorfit
Expand All @@ -7,6 +10,7 @@ import io.github.droidkaigi.confsched.data.sponsors.response.SponsorResponse
import io.github.droidkaigi.confsched.data.sponsors.response.SponsorsResponse
import io.github.droidkaigi.confsched.model.Plan
import io.github.droidkaigi.confsched.model.Sponsor
import io.github.droidkaigi.confsched.model.fakes
import kotlinx.collections.immutable.PersistentList
import kotlinx.collections.immutable.toPersistentList

Expand All @@ -22,9 +26,11 @@ public class DefaultSponsorsApiClient(

private val sponsorApi = ktorfit.create<SponsorApi>()
public override suspend fun sponsors(): PersistentList<Sponsor> {
return networkService {
sponsorApi.getSponsors()
}.toSponsorList()
// FIXME: When the API is ready, remove the comments below and return the actual data.
return Sponsor.fakes()
// return networkService {
// sponsorApi.getSponsors()
// }.toSponsorList()
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// FIXME: When the API is ready, remove Suppress annotation below.
@file:Suppress("UnusedPrivateProperty", "UnusedPrivateMember")

package io.github.droidkaigi.confsched.data.staff

import de.jensklingenberg.ktorfit.Ktorfit
Expand All @@ -6,6 +9,7 @@ import io.github.droidkaigi.confsched.data.NetworkService
import io.github.droidkaigi.confsched.data.staff.response.StaffResponse
import io.github.droidkaigi.confsched.data.staff.response.StaffsResponse
import io.github.droidkaigi.confsched.model.Staff
import io.github.droidkaigi.confsched.model.fakes
import kotlinx.collections.immutable.PersistentList
import kotlinx.collections.immutable.toPersistentList

Expand All @@ -22,9 +26,11 @@ public class DefaultStaffApiClient(
private val staffApi = ktorfit.create<StaffApi>()

public override suspend fun getStaff(): PersistentList<Staff> {
return networkService {
staffApi.getStaff()
}.toStaffList()
// FIXME: When the API is ready, remove the comments below and return the actual data.
return Staff.fakes()
// return networkService {
// staffApi.getStaff()
// }.toStaffList()
}
}

Expand Down
Loading