From: Dessalines Date: Sun, 8 May 2022 00:21:30 +0000 (-0400) Subject: Fixing unfollow X-Git-Url: http://these/git/readmes/README.ja.md?a=commitdiff_plain;h=e6fe9d0325f01bd6f1c1b8c269366a676ad5cee1;p=lemmy.git Fixing unfollow --- diff --git a/api_tests/package.json b/api_tests/package.json index 7f3a80c9..849b721e 100644 --- a/api_tests/package.json +++ b/api_tests/package.json @@ -16,7 +16,7 @@ "eslint": "^7.30.0", "eslint-plugin-jane": "^9.0.3", "jest": "^27.0.6", - "lemmy-js-client": "0.17.0-rc.1", + "lemmy-js-client": "0.17.0-rc.2", "node-fetch": "^2.6.1", "prettier": "^2.3.2", "ts-jest": "^27.0.3", diff --git a/api_tests/src/follow.spec.ts b/api_tests/src/follow.spec.ts index a78a7e73..d75735b0 100644 --- a/api_tests/src/follow.spec.ts +++ b/api_tests/src/follow.spec.ts @@ -38,7 +38,7 @@ test('Follow federated community', async () => { // Test an unfollow let unfollow = await followCommunity(alpha, false, remoteCommunityId); - expect(unfollow.community_follower_view.community.local).toBe(false); + expect(unfollow.community_follower_view).toBeNull() // Make sure you are unsubbed locally let siteUnfollowCheck = await getSite(alpha); diff --git a/api_tests/yarn.lock b/api_tests/yarn.lock index e618b26a..8e075486 100644 --- a/api_tests/yarn.lock +++ b/api_tests/yarn.lock @@ -3076,10 +3076,10 @@ language-tags@^1.0.5: dependencies: language-subtag-registry "~0.3.2" -lemmy-js-client@0.17.0-rc.1: - version "0.17.0-rc.1" - resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.0-rc.1.tgz#153fae5a06f047fe59a00847589b80736a30277b" - integrity sha512-dHkL5eXHTSxchyxn8yXj33iuh1UQ8OmebUJY6PstQPxL8ZOFBKlVEJs8UlXBJgeDkDTc2OObNpUd2uFqhEt6jg== +lemmy-js-client@0.17.0-rc.2: + version "0.17.0-rc.2" + resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.0-rc.2.tgz#4e6ff9a8d83ac922cd36eeaa01c657b3b93309e6" + integrity sha512-2YkZiAkq2ZUHPSl/B7pvMMkI19XRtTKwLFJ1u4NT2BlFkNdlvkvkOddnJ6aRwKAp/WBohxoKLoDHhlwePS5gqA== leven@^3.1.0: version "3.1.0" diff --git a/crates/api/src/community/follow.rs b/crates/api/src/community/follow.rs index df9fae3c..b73e130d 100644 --- a/crates/api/src/community/follow.rs +++ b/crates/api/src/community/follow.rs @@ -85,7 +85,7 @@ impl Perform for FollowCommunity { let community_follower_view = blocking(context.pool(), move |conn| { CommunityFollowerView::read(conn, community_id, person_id) }) - .await??; + .await?.ok(); Ok(Self::Response { community_follower_view, diff --git a/crates/api_common/src/community.rs b/crates/api_common/src/community.rs index a4b5e2e6..3c0f33d1 100644 --- a/crates/api_common/src/community.rs +++ b/crates/api_common/src/community.rs @@ -47,8 +47,9 @@ pub struct CommunityResponse { } #[derive(Debug, Serialize, Deserialize, Clone)] +/// An unfollow will return None pub struct FollowCommunityResponse { - pub community_follower_view: CommunityFollowerView, + pub community_follower_view: Option, } #[derive(Debug, Serialize, Deserialize, Clone, Default)]