X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fapi_crud%2Fsrc%2Fcomment%2Flist.rs;h=9ab7d6d0247d373abf2d2a664387d1e40c9554ca;hb=235cc8b22897bfb3e71ba3dbd725d36863fea8ba;hp=92e1771c99cf1deb26ec7c74e7b8da4498da409d;hpb=276a8c2bd3e4fd1323e66b808675cf14cf6f75c5;p=lemmy.git diff --git a/crates/api_crud/src/comment/list.rs b/crates/api_crud/src/comment/list.rs index 92e1771c..9ab7d6d0 100644 --- a/crates/api_crud/src/comment/list.rs +++ b/crates/api_crud/src/comment/list.rs @@ -11,7 +11,7 @@ use lemmy_api_common::{ }; use lemmy_apub::{fetcher::resolve_actor_identifier, objects::community::ApubCommunity}; use lemmy_db_schema::{ - source::{comment::Comment, community::Community}, + source::{comment::Comment, community::Community, local_site::LocalSite}, traits::{Crud, DeleteableOrRemoveable}, }; use lemmy_db_views::comment_view::CommentQuery; @@ -32,10 +32,11 @@ impl PerformCrud for GetComments { let local_user_view = get_local_user_view_from_jwt_opt(data.auth.as_ref(), context.pool(), context.secret()) .await?; - check_private_instance(&local_user_view, context.pool()).await?; + let local_site = blocking(context.pool(), LocalSite::read).await??; + check_private_instance(&local_user_view, &local_site)?; let community_id = data.community_id; - let listing_type = listing_type_with_site_default(data.type_, context.pool()).await?; + let listing_type = listing_type_with_site_default(data.type_, &local_site)?; let community_actor_id = if let Some(name) = &data.community_name { resolve_actor_identifier::(name, context, true)