-
-
Notifications
You must be signed in to change notification settings - Fork 897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Combined modlog #5253
Adding Combined modlog #5253
Changes from 9 commits
39b3ec2
1ff8ae0
2351c7a
0ba961f
d8dda44
d68c0a6
a9f28af
3adadf9
588e1f6
f25d346
7fdbb58
00beccd
1776de2
612c2e9
5a8b9de
0c854d2
802a8a6
4674821
91ca6d3
4cac67c
83988cd
82a14fc
1f28407
34a440a
1a739a1
e1affa8
921d532
724856d
1053df1
32b5411
3abc46f
a940ce3
67d72e3
a4de41d
5d2b611
a0f2966
165c7f4
dc0ec15
22d8697
fa31fc3
10f5e37
02bd2f6
40fead2
2d482b3
3e31e1c
cf2b00e
58e62d5
15d1faa
a8951ef
a320f5a
63b7f72
5c2205a
6363e7d
9d36f1f
c157b8f
cdd5f65
6318cac
b3b8efd
1e6b3fb
c72d5e8
942da64
7c962d6
ae9da4d
af543cc
b4ce1d9
154cea9
0b514c5
a1792bb
cfd302d
9a0e050
776c500
bd5210a
8d856a0
4bc4876
918c5e8
2244fd0
b6d0ecf
5cf0bb8
b46fdab
e5e11c1
03e876b
d27a634
be4a05e
15f1671
4317917
0723ef2
d64a086
9b561df
d09616c
b1d4e9c
0a7d88f
46bbf2f
4b71bc6
45e312f
11e9514
50043af
b021e4b
143da4b
c3a74f9
85d8810
38f5f4e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,25 +42,7 @@ use lemmy_db_views_actor::structs::{ | |
CommunityView, | ||
PersonView, | ||
}; | ||
use lemmy_db_views_moderator::structs::{ | ||
AdminAllowInstanceView, | ||
AdminBlockInstanceView, | ||
AdminPurgeCommentView, | ||
AdminPurgeCommunityView, | ||
AdminPurgePersonView, | ||
AdminPurgePostView, | ||
ModAddCommunityView, | ||
ModAddView, | ||
ModBanFromCommunityView, | ||
ModBanView, | ||
ModFeaturePostView, | ||
ModHideCommunityView, | ||
ModLockPostView, | ||
ModRemoveCommentView, | ||
ModRemoveCommunityView, | ||
ModRemovePostView, | ||
ModTransferCommunityView, | ||
}; | ||
use lemmy_db_views_moderator::structs::{ModlogCombinedPaginationCursor, ModlogCombinedView}; | ||
use serde::{Deserialize, Serialize}; | ||
use serde_with::skip_serializing_none; | ||
#[cfg(feature = "full")] | ||
|
@@ -139,7 +121,7 @@ pub struct ResolveObjectResponse { | |
} | ||
|
||
#[skip_serializing_none] | ||
#[derive(Debug, Serialize, Deserialize, Clone, Copy, Default, PartialEq, Eq, Hash)] | ||
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)] | ||
#[cfg_attr(feature = "full", derive(TS))] | ||
#[cfg_attr(feature = "full", ts(export))] | ||
/// Fetches the modlog. | ||
|
@@ -149,17 +131,17 @@ pub struct GetModlog { | |
#[cfg_attr(feature = "full", ts(optional))] | ||
pub community_id: Option<CommunityId>, | ||
#[cfg_attr(feature = "full", ts(optional))] | ||
pub page: Option<i64>, | ||
#[cfg_attr(feature = "full", ts(optional))] | ||
pub limit: Option<i64>, | ||
#[cfg_attr(feature = "full", ts(optional))] | ||
pub type_: Option<ModlogActionType>, | ||
#[cfg_attr(feature = "full", ts(optional))] | ||
pub other_person_id: Option<PersonId>, | ||
pub modded_person_id: Option<PersonId>, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed the name of this everywhere I could, to be more consistent. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's only in the schema. I'm going to change the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should keep api and db schema consistent, otherwise it can be confusing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've done that now, and removed all instances of |
||
#[cfg_attr(feature = "full", ts(optional))] | ||
pub post_id: Option<PostId>, | ||
#[cfg_attr(feature = "full", ts(optional))] | ||
pub comment_id: Option<CommentId>, | ||
#[cfg_attr(feature = "full", ts(optional))] | ||
pub page_cursor: Option<ModlogCombinedPaginationCursor>, | ||
#[cfg_attr(feature = "full", ts(optional))] | ||
pub page_back: Option<bool>, | ||
} | ||
|
||
#[derive(Debug, Serialize, Deserialize, Clone)] | ||
|
@@ -168,23 +150,7 @@ pub struct GetModlog { | |
/// The modlog fetch response. | ||
// TODO this should be redone as a list of tagged enums | ||
dessalines marked this conversation as resolved.
Show resolved
Hide resolved
|
||
pub struct GetModlogResponse { | ||
pub removed_posts: Vec<ModRemovePostView>, | ||
pub locked_posts: Vec<ModLockPostView>, | ||
pub featured_posts: Vec<ModFeaturePostView>, | ||
pub removed_comments: Vec<ModRemoveCommentView>, | ||
pub removed_communities: Vec<ModRemoveCommunityView>, | ||
pub banned_from_community: Vec<ModBanFromCommunityView>, | ||
pub banned: Vec<ModBanView>, | ||
pub added_to_community: Vec<ModAddCommunityView>, | ||
pub transferred_to_community: Vec<ModTransferCommunityView>, | ||
pub added: Vec<ModAddView>, | ||
pub admin_purged_persons: Vec<AdminPurgePersonView>, | ||
pub admin_purged_communities: Vec<AdminPurgeCommunityView>, | ||
pub admin_purged_posts: Vec<AdminPurgePostView>, | ||
pub admin_purged_comments: Vec<AdminPurgeCommentView>, | ||
pub hidden_communities: Vec<ModHideCommunityView>, | ||
pub admin_block_instance: Vec<AdminBlockInstanceView>, | ||
pub admin_allow_instance: Vec<AdminAllowInstanceView>, | ||
pub modlog: Vec<ModlogCombinedView>, | ||
} | ||
|
||
#[skip_serializing_none] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API changes here let us remove all these view types.