mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-06-06 23:49:23 +00:00
Use Post instead of PostView
This commit is contained in:
parent
79128ee4c3
commit
d7374b7d6e
|
@ -4,7 +4,8 @@ use lemmy_api_common::{
|
|||
post::{ListPostLikes, ListPostLikesResponse},
|
||||
utils::is_mod_or_admin,
|
||||
};
|
||||
use lemmy_db_views::structs::{LocalUserView, PostView, VoteView};
|
||||
use lemmy_db_schema::{source::post::Post, traits::Crud};
|
||||
use lemmy_db_views::structs::{LocalUserView, VoteView};
|
||||
use lemmy_utils::error::LemmyError;
|
||||
|
||||
/// Lists likes for a post
|
||||
|
@ -14,17 +15,11 @@ pub async fn list_post_likes(
|
|||
context: Data<LemmyContext>,
|
||||
local_user_view: LocalUserView,
|
||||
) -> Result<Json<ListPostLikesResponse>, LemmyError> {
|
||||
let post_view = PostView::read(
|
||||
&mut context.pool(),
|
||||
data.post_id,
|
||||
Some(local_user_view.person.id),
|
||||
false,
|
||||
)
|
||||
.await?;
|
||||
let post = Post::read(&mut context.pool(), data.post_id).await?;
|
||||
is_mod_or_admin(
|
||||
&mut context.pool(),
|
||||
&local_user_view.person,
|
||||
post_view.community.id,
|
||||
post.community_id,
|
||||
)
|
||||
.await?;
|
||||
|
||||
|
|
|
@ -296,7 +296,7 @@ impl InstanceWorker {
|
|||
}
|
||||
if let Some(t) = &activity.send_community_followers_of {
|
||||
if let Some(urls) = self.followed_communities.get(t) {
|
||||
inbox_urls.extend(urls.iter().map(std::clone::Clone::clone));
|
||||
inbox_urls.extend(urls.iter().cloned());
|
||||
}
|
||||
}
|
||||
inbox_urls.extend(
|
||||
|
|
Loading…
Reference in a new issue