]> Untitled Git - lemmy.git/commitdiff
Fixing unfollow
authorDessalines <tyhou13@gmx.com>
Sun, 8 May 2022 00:21:30 +0000 (20:21 -0400)
committerNutomic <me@nutomic.com>
Fri, 20 May 2022 16:15:14 +0000 (16:15 +0000)
api_tests/package.json
api_tests/src/follow.spec.ts
api_tests/yarn.lock
crates/api/src/community/follow.rs
crates/api_common/src/community.rs

index 7f3a80c923700dd8f8691641f20a16a55045019c..849b721e7daee62d5451b3c4f36fea02ccc73cfb 100644 (file)
@@ -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",
index a78a7e73f46cf8bb6568a5d814b010d5d035745f..d75735b00e402421ff050842b3974e606c8e075f 100644 (file)
@@ -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);
index e618b26a114ec9b60f95d179021737116fb8fe16..8e07548633f8900f84cf7e8324154f1ac005ee03 100644 (file)
@@ -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"
index df9fae3cfaa5d2cd04b51fdae2862f13440a09dd..b73e130d10ac189eb4b2b4eba5b9db2822f9d3bc 100644 (file)
@@ -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,
index a4b5e2e6f9b6bf55f3ceb6bbefa5526de050f2b9..3c0f33d1c6c65fd5a2464c7b13f991f631e2314c 100644 (file)
@@ -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<CommunityFollowerView>,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone, Default)]