diff --git a/core/network/src/commonMain/kotlin/com/stslex/core/network/clients/profile/client/MockProfileClientImpl.kt b/core/network/src/commonMain/kotlin/com/stslex/core/network/clients/profile/client/MockProfileClientImpl.kt index 3721ea71..fdf11de7 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/core/network/clients/profile/client/MockProfileClientImpl.kt +++ b/core/network/src/commonMain/kotlin/com/stslex/core/network/clients/profile/client/MockProfileClientImpl.kt @@ -74,6 +74,7 @@ class MockProfileClientImpl : ProfileClient { override suspend fun getFollowers( uuid: String, + query: String, page: Int, pageSize: Int ): UserFollowerResponse { @@ -92,6 +93,7 @@ class MockProfileClientImpl : ProfileClient { override suspend fun getFollowing( uuid: String, + query: String, page: Int, pageSize: Int ): UserFollowerResponse { diff --git a/core/network/src/commonMain/kotlin/com/stslex/core/network/clients/profile/client/ProfileClient.kt b/core/network/src/commonMain/kotlin/com/stslex/core/network/clients/profile/client/ProfileClient.kt index d22e5412..e7700f84 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/core/network/clients/profile/client/ProfileClient.kt +++ b/core/network/src/commonMain/kotlin/com/stslex/core/network/clients/profile/client/ProfileClient.kt @@ -27,12 +27,14 @@ interface ProfileClient { suspend fun getFollowers( uuid: String, + query: String, page: Int, pageSize: Int ): UserFollowerResponse suspend fun getFollowing( uuid: String, + query: String, page: Int, pageSize: Int ): UserFollowerResponse diff --git a/core/network/src/commonMain/kotlin/com/stslex/core/network/clients/profile/client/ProfileClientImpl.kt b/core/network/src/commonMain/kotlin/com/stslex/core/network/clients/profile/client/ProfileClientImpl.kt index 599e1179..9f185ff7 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/core/network/clients/profile/client/ProfileClientImpl.kt +++ b/core/network/src/commonMain/kotlin/com/stslex/core/network/clients/profile/client/ProfileClientImpl.kt @@ -58,11 +58,13 @@ class ProfileClientImpl( override suspend fun getFollowers( uuid: String, + query: String, page: Int, pageSize: Int ): UserFollowerResponse = client.request { get("$HOST/followers") { parameter("uuid", uuid) + parameter("query", query) parameter("page", page) parameter("page_size", pageSize) }.body() @@ -70,11 +72,13 @@ class ProfileClientImpl( override suspend fun getFollowing( uuid: String, + query: String, page: Int, pageSize: Int ): UserFollowerResponse = client.request { get("$HOST/following") { parameter("uuid", uuid) + parameter("query", query) parameter("page", page) parameter("page_size", pageSize) }.body() diff --git a/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/data/repository/FollowerRepository.kt b/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/data/repository/FollowerRepository.kt index b2a48030..0658b7f6 100644 --- a/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/data/repository/FollowerRepository.kt +++ b/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/data/repository/FollowerRepository.kt @@ -7,12 +7,14 @@ interface FollowerRepository { fun getFollowers( uuid: String, + query: String, page: Int, pageSize: Int ): Flow> fun getFollowing( uuid: String, + query: String, page: Int, pageSize: Int ): Flow> diff --git a/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/data/repository/FollowerRepositoryImpl.kt b/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/data/repository/FollowerRepositoryImpl.kt index 8d3e2ea5..def3b49e 100644 --- a/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/data/repository/FollowerRepositoryImpl.kt +++ b/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/data/repository/FollowerRepositoryImpl.kt @@ -12,11 +12,13 @@ class FollowerRepositoryImpl( override fun getFollowers( uuid: String, + query: String, page: Int, pageSize: Int ): Flow> = flow { val result = client.getFollowers( uuid = uuid, + query = query, page = page, pageSize = pageSize ).toData() @@ -25,11 +27,13 @@ class FollowerRepositoryImpl( override fun getFollowing( uuid: String, + query: String, page: Int, pageSize: Int ): Flow> = flow { val result = client.getFollowing( uuid = uuid, + query = query, page = page, pageSize = pageSize ).toData() diff --git a/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/domain/interactor/FollowerInteractor.kt b/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/domain/interactor/FollowerInteractor.kt index 94416d74..e8ddf546 100644 --- a/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/domain/interactor/FollowerInteractor.kt +++ b/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/domain/interactor/FollowerInteractor.kt @@ -7,12 +7,14 @@ interface FollowerInteractor { fun getFollowers( uuid: String, + query: String, page: Int, pageSize: Int ): Flow> fun getFollowing( uuid: String, + query: String, page: Int, pageSize: Int ): Flow> diff --git a/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/domain/interactor/FollowerInteractorImpl.kt b/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/domain/interactor/FollowerInteractorImpl.kt index 9857f41f..ea98e162 100644 --- a/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/domain/interactor/FollowerInteractorImpl.kt +++ b/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/domain/interactor/FollowerInteractorImpl.kt @@ -12,10 +12,13 @@ class FollowerInteractorImpl( override fun getFollowers( uuid: String, - page: Int, pageSize: Int + query: String, + page: Int, + pageSize: Int ): Flow> = repository .getFollowers( uuid = uuid, + query = query, page = page, pageSize = pageSize ) @@ -23,11 +26,13 @@ class FollowerInteractorImpl( override fun getFollowing( uuid: String, + query: String, page: Int, pageSize: Int ): Flow> = repository .getFollowing( uuid = uuid, + query = query, page = page, pageSize = pageSize ) diff --git a/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/ui/store/FollowerStore.kt b/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/ui/store/FollowerStore.kt index 74dd504f..8940d858 100644 --- a/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/ui/store/FollowerStore.kt +++ b/feature/follower/src/commonMain/kotlin/com.stslex.feature.follower/ui/store/FollowerStore.kt @@ -72,12 +72,14 @@ class FollowerStore( loadingJob = when (val type = currentState.type) { is FollowerScreenArgs.Follower -> interactor.getFollowers( uuid = type.uuid, + query = "", // todo add query page = page, pageSize = PAGE_SIZE ) is FollowerScreenArgs.Following -> interactor.getFollowing( uuid = type.uuid, + query = "", // todo add query page = page, pageSize = PAGE_SIZE )