mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-02-27 16:16:36 +00:00
remve site from GetCommunityResponse
This commit is contained in:
parent
3da2804d4b
commit
52ce279664
3 changed files with 2 additions and 24 deletions
|
@ -516,7 +516,6 @@ impl Perform for TransferCommunity {
|
|||
community_view,
|
||||
moderators,
|
||||
online: 0,
|
||||
site: None,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
use lemmy_db_schema::{
|
||||
newtypes::{CommunityId, PersonId},
|
||||
source::site::Site,
|
||||
};
|
||||
use lemmy_db_schema::newtypes::{CommunityId, PersonId};
|
||||
use lemmy_db_views_actor::{
|
||||
community_moderator_view::CommunityModeratorView,
|
||||
community_view::CommunityView,
|
||||
|
@ -23,12 +20,6 @@ pub struct GetCommunityResponse {
|
|||
pub community_view: CommunityView,
|
||||
pub moderators: Vec<CommunityModeratorView>,
|
||||
pub online: usize,
|
||||
/// Metadata of the instance where the community is located. Only fields name, sidebar,
|
||||
/// description, icon, banner, actor_id, last_refreshed_at get federated, everything else uses
|
||||
/// default values. May be null if the community is hosted on an older Lemmy version, or on
|
||||
/// another software.
|
||||
/// TODO: this should probably be SiteView
|
||||
pub site: Option<Site>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
|
|
|
@ -7,10 +7,9 @@ use lemmy_api_common::{
|
|||
get_local_user_view_from_jwt_opt,
|
||||
resolve_actor_identifier,
|
||||
};
|
||||
use lemmy_apub::objects::instance::instance_actor_id_from_url;
|
||||
use lemmy_db_schema::{
|
||||
from_opt_str_to_opt_enum,
|
||||
source::{community::Community, site::Site},
|
||||
source::community::Community,
|
||||
traits::DeleteableOrRemoveable,
|
||||
ListingType,
|
||||
SortType,
|
||||
|
@ -79,21 +78,10 @@ impl PerformCrud for GetCommunity {
|
|||
.await
|
||||
.unwrap_or(1);
|
||||
|
||||
let site_id = instance_actor_id_from_url(community_view.community.actor_id.clone().into());
|
||||
let site = blocking(context.pool(), move |conn| {
|
||||
Site::read_from_apub_id(conn, site_id)
|
||||
})
|
||||
.await
|
||||
.map(|s| s.ok())
|
||||
.ok()
|
||||
.flatten()
|
||||
.flatten();
|
||||
|
||||
let res = GetCommunityResponse {
|
||||
community_view,
|
||||
moderators,
|
||||
online,
|
||||
site,
|
||||
};
|
||||
|
||||
// Return the jwt
|
||||
|
|
Loading…
Reference in a new issue