diff --git a/dnas/mewsfeed/zomes/coordinator/follows/src/follower_to_creators.rs b/dnas/mewsfeed/zomes/coordinator/follows/src/follower_to_creators.rs index 54af1af9..b777ced1 100644 --- a/dnas/mewsfeed/zomes/coordinator/follows/src/follower_to_creators.rs +++ b/dnas/mewsfeed/zomes/coordinator/follows/src/follower_to_creators.rs @@ -52,6 +52,34 @@ pub fn get_followers_for_creator( Ok(agents) } +#[hdk_extern] +pub fn count_creators_for_follower( + follower: AgentPubKey, +) -> ExternResult { + let query = LinkQuery::new( + follower, + LinkTypeFilter::single_type( + ZomeIndex(2), + LinkType(0), // LinkTypes::FollowerToCreators + ), + ); + count_links(query) +} + +#[hdk_extern] +pub fn count_followers_for_creator( + creator: AgentPubKey, +) -> ExternResult { + let query = LinkQuery::new( + creator, + LinkTypeFilter::single_type( + ZomeIndex(2), + LinkType(1), // LinkTypes::CreatorToFollowers + ), + ); + count_links(query) +} + #[hdk_extern] pub fn get_follower_links_for_creator( input: GetFollowersForCreatorInput, diff --git a/ui/src/components/BaseAgentProfileDetail.vue b/ui/src/components/BaseAgentProfileDetail.vue index 1545340a..7f9d1d5c 100644 --- a/ui/src/components/BaseAgentProfileDetail.vue +++ b/ui/src/components/BaseAgentProfileDetail.vue @@ -95,6 +95,7 @@ v-if="!isMyProfile" :agentPubKey="agentPubKey" :big="bigFollowButton" + @toggle-follow="(val) => emit('toggle-follow', val)" />