From c9c0aaf148034d46c1218a85067461d90579f50b Mon Sep 17 00:00:00 2001 From: CMK Date: Tue, 2 Nov 2021 16:01:22 +0800 Subject: [PATCH] fix: follower list pagination not works issue --- Mastodon/Service/APIService/APIService+Follower.swift | 5 +++++ .../MastodonSDK/API/Mastodon+API+Account+Followers.swift | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Mastodon/Service/APIService/APIService+Follower.swift b/Mastodon/Service/APIService/APIService+Follower.swift index db29a0a2..f75d2420 100644 --- a/Mastodon/Service/APIService/APIService+Follower.swift +++ b/Mastodon/Service/APIService/APIService+Follower.swift @@ -23,10 +23,15 @@ extension APIService { let authorization = authorizationBox.userAuthorization let requestMastodonUserID = authorizationBox.userID + let query = Mastodon.API.Account.FollowerQuery( + maxID: maxID, + limit: nil + ) return Mastodon.API.Account.followers( session: session, domain: domain, userID: userID, + query: query, authorization: authorization ) .flatMap { response -> AnyPublisher, Error> in diff --git a/MastodonSDK/Sources/MastodonSDK/API/Mastodon+API+Account+Followers.swift b/MastodonSDK/Sources/MastodonSDK/API/Mastodon+API+Account+Followers.swift index b09a5f07..a900a1c1 100644 --- a/MastodonSDK/Sources/MastodonSDK/API/Mastodon+API+Account+Followers.swift +++ b/MastodonSDK/Sources/MastodonSDK/API/Mastodon+API+Account+Followers.swift @@ -35,11 +35,12 @@ extension Mastodon.API.Account { session: URLSession, domain: String, userID: Mastodon.Entity.Account.ID, + query: FollowerQuery, authorization: Mastodon.API.OAuth.Authorization ) -> AnyPublisher, Error> { let request = Mastodon.API.get( url: followersEndpointURL(domain: domain, userID: userID), - query: nil, + query: query, authorization: authorization ) return session.dataTaskPublisher(for: request)