mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-13 06:08:20 +00:00
Starting to work on combined views.
This commit is contained in:
parent
15d1faad72
commit
a8951efb1a
|
@ -286,6 +286,50 @@ pub struct ModlogListParams {
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
pub page: Option<i64>,
|
pub page: Option<i64>,
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
|
// TODO page_after, page_back
|
||||||
pub limit: Option<i64>,
|
pub limit: Option<i64>,
|
||||||
pub hide_modlog_names: bool,
|
pub hide_modlog_names: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(Queryable))]
|
||||||
|
#[cfg_attr(feature = "full", diesel(check_for_backend(diesel::pg::Pg)))]
|
||||||
|
/// A combined modlog view
|
||||||
|
pub struct ModlogCombinedViewInternal {
|
||||||
|
// Post-specific
|
||||||
|
// Shared
|
||||||
|
pub report_creator: Person,
|
||||||
|
pub item_creator: Person,
|
||||||
|
pub community: Option<Community>,
|
||||||
|
pub subscribed: SubscribedType,
|
||||||
|
pub resolver: Option<Person>,
|
||||||
|
pub item_creator_is_admin: bool,
|
||||||
|
pub item_creator_banned_from_community: bool,
|
||||||
|
pub item_creator_is_moderator: bool,
|
||||||
|
pub item_creator_blocked: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
|
// Use serde's internal tagging, to work easier with javascript libraries
|
||||||
|
#[serde(tag = "type_")]
|
||||||
|
pub enum ModlogCombinedView {
|
||||||
|
AdminAllowInstance(AdminAllowInstanceView),
|
||||||
|
AdminBlockInstance(AdminBlockInstanceView),
|
||||||
|
AdminPurgeComment(AdminPurgeCommentView),
|
||||||
|
AdminPurgeCommunity(AdminPurgeCommunityView),
|
||||||
|
AdminPurgePerson(AdminPurgePersonView),
|
||||||
|
AdminPurgePost(AdminPurgePostView),
|
||||||
|
ModAdd(ModAddView),
|
||||||
|
ModAddCommunity(ModAddCommunityView),
|
||||||
|
ModBan(ModBanView),
|
||||||
|
ModBanFromCommunity(ModBanFromCommunityView),
|
||||||
|
ModFeaturePost(ModFeaturePostView),
|
||||||
|
ModHideCommunity(ModHideCommunityView),
|
||||||
|
ModLockPost(ModLockPostView),
|
||||||
|
ModRemoveComment(ModRemoveCommentView),
|
||||||
|
ModRemoveCommunity(ModRemoveCommunityView),
|
||||||
|
ModRemovePost(ModRemovePostView),
|
||||||
|
ModTransferCommunity(ModTransferCommunityView),
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue