Skip to content

Commit

Permalink
fix(#96-add-support-quit-meeting-request): added support remove /rela…
Browse files Browse the repository at this point in the history
…tionship route
  • Loading branch information
y9Kap committed Mar 14, 2024
1 parent 5e556fc commit 866eda9
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ internal class FriendsEngine(
}

suspend fun subscriptions(request: GetSubscriptionsRequest): GetSubscriptionsRequest.Response {
val url = baseUrl / "relationship" / "subscriptions"
val url = baseUrl / "subscriptions"

val response = httpClient.get(url.string) {
apiVersion(request.apiVersion)
Expand All @@ -113,7 +113,7 @@ internal class FriendsEngine(
}

suspend fun subscribers(request: GetSubscribersRequest): GetSubscribersRequest.Response {
val url = baseUrl / "relationship" / "subscribers"
val url = baseUrl / "subscribers"

val response = httpClient.get(url.string) {
apiVersion(request.apiVersion)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class AuthorizedFriendsApi(private val api: AuthorizedMeetacyApi) {
AuthorizedUserDetailsRepository.of(user.data, api)
}

public fun paging(
public fun listPaging(
chunkSize: Amount,
startPagingId: PagingId? = null,
limit: Amount? = null
Expand All @@ -69,4 +69,26 @@ public class AuthorizedFriendsApi(private val api: AuthorizedMeetacyApi) {
list(currentAmount, currentPagingId).response
}
}
public fun subscribersPaging(
chunkSize: Amount,
startPagingId: PagingId? = null,
limit: Amount? = null
): PagingSource<AuthorizedUserDetailsRepository> {
return PagingSource(
chunkSize, startPagingId, limit
) { currentAmount, currentPagingId ->
subscribers(currentAmount, currentPagingId).response
}
}
public fun subscriptionsPaging(
chunkSize: Amount,
startPagingId: PagingId? = null,
limit: Amount? = null
): PagingSource<AuthorizedUserDetailsRepository> {
return PagingSource(
chunkSize, startPagingId, limit
) { currentAmount, currentPagingId ->
subscriptions(currentAmount, currentPagingId).response
}
}
}
26 changes: 25 additions & 1 deletion api/src/commonMain/kotlin/app/meetacy/sdk/friends/FriendsApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public class FriendsApi(private val api: MeetacyApi) {
}
}

public fun paging(
public fun listPaging(
token: Token,
chunkSize: Amount,
startPagingId: PagingId? = null,
Expand All @@ -99,4 +99,28 @@ public class FriendsApi(private val api: MeetacyApi) {
list(token, currentAmount, currentPagingId).response
}
}
public fun subscribersPaging(
token: Token,
chunkSize: Amount,
startPagingId: PagingId? = null,
limit: Amount? = null
): PagingSource<UserDetailsRepository> {
return PagingSource(
chunkSize, startPagingId, limit
) { currentAmount, currentPagingId ->
subscribers(token, currentAmount, currentPagingId).response
}
}
public fun subscriptionsPaging(
token: Token,
chunkSize: Amount,
startPagingId: PagingId? = null,
limit: Amount? = null
): PagingSource<UserDetailsRepository> {
return PagingSource(
chunkSize, startPagingId, limit
) { currentAmount, currentPagingId ->
subscriptions(token, currentAmount, currentPagingId).response
}
}
}

0 comments on commit 866eda9

Please sign in to comment.