Merge remote-tracking branch 'origin/main' into post_link_alt_text

This commit is contained in:
Dessalines 2024-03-04 12:24:50 -05:00
commit 09516e1875
7 changed files with 26 additions and 1 deletions

View file

@ -55,10 +55,15 @@ pub async fn get_mod_log(
data.mod_person_id
};
let other_person_id = data.other_person_id;
let post_id = data.post_id;
let comment_id = data.comment_id;
let params = ModlogListParams {
community_id,
mod_person_id,
other_person_id,
post_id,
comment_id,
page: data.page,
limit: data.limit,
hide_modlog_names,

View file

@ -118,6 +118,8 @@ pub struct GetModlog {
pub limit: Option<i64>,
pub type_: Option<ModlogActionType>,
pub other_person_id: Option<PersonId>,
pub post_id: Option<PostId>,
pub comment_id: Option<CommentId>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]

View file

@ -51,6 +51,10 @@ impl ModFeaturePostView {
query = query.filter(person_alias_1.field(person::id).eq(other_person_id));
};
if let Some(post_id) = params.post_id {
query = query.filter(post::id.eq(post_id));
}
let (limit, offset) = limit_and_offset(params.page, params.limit)?;
query

View file

@ -52,6 +52,10 @@ impl ModLockPostView {
query = query.filter(person_alias_1.field(person::id).eq(other_person_id));
};
if let Some(post_id) = params.post_id {
query = query.filter(post::id.eq(post_id));
}
let (limit, offset) = limit_and_offset(params.page, params.limit)?;
query

View file

@ -54,6 +54,10 @@ impl ModRemoveCommentView {
query = query.filter(person_alias_1.field(person::id).eq(other_person_id));
};
if let Some(comment_id) = params.comment_id {
query = query.filter(comment::id.eq(comment_id));
}
let (limit, offset) = limit_and_offset(params.page, params.limit)?;
query

View file

@ -52,6 +52,10 @@ impl ModRemovePostView {
query = query.filter(person_alias_1.field(person::id).eq(other_person_id));
};
if let Some(post_id) = params.post_id {
query = query.filter(post::id.eq(post_id));
}
let (limit, offset) = limit_and_offset(params.page, params.limit)?;
query

View file

@ -1,7 +1,7 @@
#[cfg(feature = "full")]
use diesel::Queryable;
use lemmy_db_schema::{
newtypes::{CommunityId, PersonId},
newtypes::{CommentId, CommunityId, PersonId, PostId},
source::{
comment::Comment,
community::Community,
@ -228,6 +228,8 @@ pub struct ModlogListParams {
pub community_id: Option<CommunityId>,
pub mod_person_id: Option<PersonId>,
pub other_person_id: Option<PersonId>,
pub post_id: Option<PostId>,
pub comment_id: Option<CommentId>,
pub page: Option<i64>,
pub limit: Option<i64>,
pub hide_modlog_names: bool,