Fixing unfollow

expose_pending
Dessalines 2022-05-07 20:21:30 -04:00 committed by Nutomic
parent ed9b66541e
commit e6fe9d0325
5 changed files with 9 additions and 8 deletions

View File

@ -16,7 +16,7 @@
"eslint": "^7.30.0", "eslint": "^7.30.0",
"eslint-plugin-jane": "^9.0.3", "eslint-plugin-jane": "^9.0.3",
"jest": "^27.0.6", "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", "node-fetch": "^2.6.1",
"prettier": "^2.3.2", "prettier": "^2.3.2",
"ts-jest": "^27.0.3", "ts-jest": "^27.0.3",

View File

@ -38,7 +38,7 @@ test('Follow federated community', async () => {
// Test an unfollow // Test an unfollow
let unfollow = await followCommunity(alpha, false, remoteCommunityId); 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 // Make sure you are unsubbed locally
let siteUnfollowCheck = await getSite(alpha); let siteUnfollowCheck = await getSite(alpha);

View File

@ -3076,10 +3076,10 @@ language-tags@^1.0.5:
dependencies: dependencies:
language-subtag-registry "~0.3.2" language-subtag-registry "~0.3.2"
lemmy-js-client@0.17.0-rc.1: lemmy-js-client@0.17.0-rc.2:
version "0.17.0-rc.1" version "0.17.0-rc.2"
resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.0-rc.1.tgz#153fae5a06f047fe59a00847589b80736a30277b" resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.0-rc.2.tgz#4e6ff9a8d83ac922cd36eeaa01c657b3b93309e6"
integrity sha512-dHkL5eXHTSxchyxn8yXj33iuh1UQ8OmebUJY6PstQPxL8ZOFBKlVEJs8UlXBJgeDkDTc2OObNpUd2uFqhEt6jg== integrity sha512-2YkZiAkq2ZUHPSl/B7pvMMkI19XRtTKwLFJ1u4NT2BlFkNdlvkvkOddnJ6aRwKAp/WBohxoKLoDHhlwePS5gqA==
leven@^3.1.0: leven@^3.1.0:
version "3.1.0" version "3.1.0"

View File

@ -85,7 +85,7 @@ impl Perform for FollowCommunity {
let community_follower_view = blocking(context.pool(), move |conn| { let community_follower_view = blocking(context.pool(), move |conn| {
CommunityFollowerView::read(conn, community_id, person_id) CommunityFollowerView::read(conn, community_id, person_id)
}) })
.await??; .await?.ok();
Ok(Self::Response { Ok(Self::Response {
community_follower_view, community_follower_view,

View File

@ -47,8 +47,9 @@ pub struct CommunityResponse {
} }
#[derive(Debug, Serialize, Deserialize, Clone)] #[derive(Debug, Serialize, Deserialize, Clone)]
/// An unfollow will return None
pub struct FollowCommunityResponse { pub struct FollowCommunityResponse {
pub community_follower_view: CommunityFollowerView, pub community_follower_view: Option<CommunityFollowerView>,
} }
#[derive(Debug, Serialize, Deserialize, Clone, Default)] #[derive(Debug, Serialize, Deserialize, Clone, Default)]