mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-02-10 11:04:49 +00:00
Fixing a few view's saved columns to use the optional datetime. (#5402)
- Also adds some comments for them, since its a nullable string in the generated types.
This commit is contained in:
parent
865f0734ba
commit
f0b00ccf94
6 changed files with 31 additions and 17 deletions
|
@ -293,7 +293,7 @@ impl InboxCombinedQuery {
|
||||||
post_aggregates::comments,
|
post_aggregates::comments,
|
||||||
)
|
)
|
||||||
.nullable(),
|
.nullable(),
|
||||||
post_actions::saved.nullable().is_not_null(),
|
post_actions::saved.nullable(),
|
||||||
post_actions::read.nullable().is_not_null(),
|
post_actions::read.nullable().is_not_null(),
|
||||||
post_actions::hidden.nullable().is_not_null(),
|
post_actions::hidden.nullable().is_not_null(),
|
||||||
post_actions::like_score.nullable(),
|
post_actions::like_score.nullable(),
|
||||||
|
@ -305,7 +305,7 @@ impl InboxCombinedQuery {
|
||||||
community::all_columns.nullable(),
|
community::all_columns.nullable(),
|
||||||
comment::all_columns.nullable(),
|
comment::all_columns.nullable(),
|
||||||
comment_aggregates::all_columns.nullable(),
|
comment_aggregates::all_columns.nullable(),
|
||||||
comment_actions::saved.nullable().is_not_null(),
|
comment_actions::saved.nullable(),
|
||||||
comment_actions::like_score.nullable(),
|
comment_actions::like_score.nullable(),
|
||||||
CommunityFollower::select_subscribed_type(),
|
CommunityFollower::select_subscribed_type(),
|
||||||
person::all_columns,
|
person::all_columns,
|
||||||
|
|
|
@ -281,7 +281,7 @@ impl ReportCombinedQuery {
|
||||||
post_aggregates::comments,
|
post_aggregates::comments,
|
||||||
)
|
)
|
||||||
.nullable(),
|
.nullable(),
|
||||||
post_actions::saved.nullable().is_not_null(),
|
post_actions::saved.nullable(),
|
||||||
post_actions::read.nullable().is_not_null(),
|
post_actions::read.nullable().is_not_null(),
|
||||||
post_actions::hidden.nullable().is_not_null(),
|
post_actions::hidden.nullable().is_not_null(),
|
||||||
post_actions::like_score.nullable(),
|
post_actions::like_score.nullable(),
|
||||||
|
@ -289,7 +289,7 @@ impl ReportCombinedQuery {
|
||||||
comment_report::all_columns.nullable(),
|
comment_report::all_columns.nullable(),
|
||||||
comment::all_columns.nullable(),
|
comment::all_columns.nullable(),
|
||||||
comment_aggregates::all_columns.nullable(),
|
comment_aggregates::all_columns.nullable(),
|
||||||
comment_actions::saved.nullable().is_not_null(),
|
comment_actions::saved.nullable(),
|
||||||
comment_actions::like_score.nullable(),
|
comment_actions::like_score.nullable(),
|
||||||
// Private-message-specific
|
// Private-message-specific
|
||||||
private_message_report::all_columns.nullable(),
|
private_message_report::all_columns.nullable(),
|
||||||
|
|
|
@ -135,7 +135,7 @@ impl CommentView {
|
||||||
creator_is_moderator: self.creator_is_moderator,
|
creator_is_moderator: self.creator_is_moderator,
|
||||||
creator_is_admin: self.creator_is_admin,
|
creator_is_admin: self.creator_is_admin,
|
||||||
subscribed: self.subscribed,
|
subscribed: self.subscribed,
|
||||||
saved: self.saved.is_some(),
|
saved: self.saved,
|
||||||
creator_blocked: self.creator_blocked,
|
creator_blocked: self.creator_blocked,
|
||||||
my_vote: self.my_vote,
|
my_vote: self.my_vote,
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,7 +136,7 @@ impl CommentReportView {
|
||||||
local_user::admin.nullable().is_not_null(),
|
local_user::admin.nullable().is_not_null(),
|
||||||
person_actions::blocked.nullable().is_not_null(),
|
person_actions::blocked.nullable().is_not_null(),
|
||||||
CommunityFollower::select_subscribed_type(),
|
CommunityFollower::select_subscribed_type(),
|
||||||
comment_actions::saved.nullable().is_not_null(),
|
comment_actions::saved.nullable(),
|
||||||
comment_actions::like_score.nullable(),
|
comment_actions::like_score.nullable(),
|
||||||
aliases::person2.fields(person::all_columns).nullable(),
|
aliases::person2.fields(person::all_columns).nullable(),
|
||||||
))
|
))
|
||||||
|
|
|
@ -120,7 +120,7 @@ impl PostReportView {
|
||||||
.is_not_null(),
|
.is_not_null(),
|
||||||
local_user::admin.nullable().is_not_null(),
|
local_user::admin.nullable().is_not_null(),
|
||||||
CommunityFollower::select_subscribed_type(),
|
CommunityFollower::select_subscribed_type(),
|
||||||
post_actions::saved.nullable().is_not_null(),
|
post_actions::saved.nullable(),
|
||||||
post_actions::read.nullable().is_not_null(),
|
post_actions::read.nullable().is_not_null(),
|
||||||
post_actions::hidden.nullable().is_not_null(),
|
post_actions::hidden.nullable().is_not_null(),
|
||||||
person_actions::blocked.nullable().is_not_null(),
|
person_actions::blocked.nullable().is_not_null(),
|
||||||
|
|
|
@ -103,7 +103,9 @@ pub struct CommentReportView {
|
||||||
pub creator_is_admin: bool,
|
pub creator_is_admin: bool,
|
||||||
pub creator_blocked: bool,
|
pub creator_blocked: bool,
|
||||||
pub subscribed: SubscribedType,
|
pub subscribed: SubscribedType,
|
||||||
pub saved: bool,
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
|
/// The time when the comment was saved.
|
||||||
|
pub saved: Option<DateTime<Utc>>,
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
pub my_vote: Option<i16>,
|
pub my_vote: Option<i16>,
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
|
@ -182,6 +184,7 @@ pub struct CommentView {
|
||||||
comment_actions::saved.nullable()
|
comment_actions::saved.nullable()
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
|
/// The time when the comment was saved.
|
||||||
pub saved: Option<DateTime<Utc>>,
|
pub saved: Option<DateTime<Utc>>,
|
||||||
#[cfg_attr(feature = "full",
|
#[cfg_attr(feature = "full",
|
||||||
diesel(
|
diesel(
|
||||||
|
@ -215,7 +218,9 @@ pub struct CommentSlimView {
|
||||||
pub creator_is_moderator: bool,
|
pub creator_is_moderator: bool,
|
||||||
pub creator_is_admin: bool,
|
pub creator_is_admin: bool,
|
||||||
pub subscribed: SubscribedType,
|
pub subscribed: SubscribedType,
|
||||||
pub saved: bool,
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
|
/// The time when the comment was saved.
|
||||||
|
pub saved: Option<DateTime<Utc>>,
|
||||||
pub creator_blocked: bool,
|
pub creator_blocked: bool,
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
pub my_vote: Option<i16>,
|
pub my_vote: Option<i16>,
|
||||||
|
@ -269,7 +274,9 @@ pub struct PostReportView {
|
||||||
pub creator_is_moderator: bool,
|
pub creator_is_moderator: bool,
|
||||||
pub creator_is_admin: bool,
|
pub creator_is_admin: bool,
|
||||||
pub subscribed: SubscribedType,
|
pub subscribed: SubscribedType,
|
||||||
pub saved: bool,
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
|
/// The time when the post was saved.
|
||||||
|
pub saved: Option<DateTime<Utc>>,
|
||||||
pub read: bool,
|
pub read: bool,
|
||||||
pub hidden: bool,
|
pub hidden: bool,
|
||||||
pub creator_blocked: bool,
|
pub creator_blocked: bool,
|
||||||
|
@ -327,6 +334,7 @@ pub struct PostView {
|
||||||
pub counts: PostAggregates,
|
pub counts: PostAggregates,
|
||||||
pub subscribed: SubscribedType,
|
pub subscribed: SubscribedType,
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
|
/// The time when the post was saved.
|
||||||
pub saved: Option<DateTime<Utc>>,
|
pub saved: Option<DateTime<Utc>>,
|
||||||
pub read: bool,
|
pub read: bool,
|
||||||
pub hidden: bool,
|
pub hidden: bool,
|
||||||
|
@ -436,7 +444,7 @@ pub struct ReportCombinedViewInternal {
|
||||||
pub post: Option<Post>,
|
pub post: Option<Post>,
|
||||||
pub post_counts: Option<PostAggregates>,
|
pub post_counts: Option<PostAggregates>,
|
||||||
pub post_unread_comments: Option<i64>,
|
pub post_unread_comments: Option<i64>,
|
||||||
pub post_saved: bool,
|
pub post_saved: Option<DateTime<Utc>>,
|
||||||
pub post_read: bool,
|
pub post_read: bool,
|
||||||
pub post_hidden: bool,
|
pub post_hidden: bool,
|
||||||
pub my_post_vote: Option<i16>,
|
pub my_post_vote: Option<i16>,
|
||||||
|
@ -444,7 +452,7 @@ pub struct ReportCombinedViewInternal {
|
||||||
pub comment_report: Option<CommentReport>,
|
pub comment_report: Option<CommentReport>,
|
||||||
pub comment: Option<Comment>,
|
pub comment: Option<Comment>,
|
||||||
pub comment_counts: Option<CommentAggregates>,
|
pub comment_counts: Option<CommentAggregates>,
|
||||||
pub comment_saved: bool,
|
pub comment_saved: Option<DateTime<Utc>>,
|
||||||
pub my_comment_vote: Option<i16>,
|
pub my_comment_vote: Option<i16>,
|
||||||
// Private-message-specific
|
// Private-message-specific
|
||||||
pub private_message_report: Option<PrivateMessageReport>,
|
pub private_message_report: Option<PrivateMessageReport>,
|
||||||
|
@ -623,7 +631,9 @@ pub struct PersonCommentMentionView {
|
||||||
pub creator_is_moderator: bool,
|
pub creator_is_moderator: bool,
|
||||||
pub creator_is_admin: bool,
|
pub creator_is_admin: bool,
|
||||||
pub subscribed: SubscribedType,
|
pub subscribed: SubscribedType,
|
||||||
pub saved: bool,
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
|
/// The time when the comment was saved.
|
||||||
|
pub saved: Option<DateTime<Utc>>,
|
||||||
pub creator_blocked: bool,
|
pub creator_blocked: bool,
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
pub my_vote: Option<i16>,
|
pub my_vote: Option<i16>,
|
||||||
|
@ -649,7 +659,9 @@ pub struct PersonPostMentionView {
|
||||||
pub creator_is_moderator: bool,
|
pub creator_is_moderator: bool,
|
||||||
pub creator_is_admin: bool,
|
pub creator_is_admin: bool,
|
||||||
pub subscribed: SubscribedType,
|
pub subscribed: SubscribedType,
|
||||||
pub saved: bool,
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
|
/// The time when the post was saved.
|
||||||
|
pub saved: Option<DateTime<Utc>>,
|
||||||
pub read: bool,
|
pub read: bool,
|
||||||
pub hidden: bool,
|
pub hidden: bool,
|
||||||
pub creator_blocked: bool,
|
pub creator_blocked: bool,
|
||||||
|
@ -678,7 +690,9 @@ pub struct CommentReplyView {
|
||||||
pub creator_is_moderator: bool,
|
pub creator_is_moderator: bool,
|
||||||
pub creator_is_admin: bool,
|
pub creator_is_admin: bool,
|
||||||
pub subscribed: SubscribedType,
|
pub subscribed: SubscribedType,
|
||||||
pub saved: bool,
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
|
/// The time when the comment was saved.
|
||||||
|
pub saved: Option<DateTime<Utc>>,
|
||||||
pub creator_blocked: bool,
|
pub creator_blocked: bool,
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
pub my_vote: Option<i16>,
|
pub my_vote: Option<i16>,
|
||||||
|
@ -752,7 +766,7 @@ pub struct InboxCombinedViewInternal {
|
||||||
pub person_post_mention: Option<PersonPostMention>,
|
pub person_post_mention: Option<PersonPostMention>,
|
||||||
pub post_counts: Option<PostAggregates>,
|
pub post_counts: Option<PostAggregates>,
|
||||||
pub post_unread_comments: Option<i64>,
|
pub post_unread_comments: Option<i64>,
|
||||||
pub post_saved: bool,
|
pub post_saved: Option<DateTime<Utc>>,
|
||||||
pub post_read: bool,
|
pub post_read: bool,
|
||||||
pub post_hidden: bool,
|
pub post_hidden: bool,
|
||||||
pub my_post_vote: Option<i16>,
|
pub my_post_vote: Option<i16>,
|
||||||
|
@ -765,7 +779,7 @@ pub struct InboxCombinedViewInternal {
|
||||||
pub community: Option<Community>,
|
pub community: Option<Community>,
|
||||||
pub comment: Option<Comment>,
|
pub comment: Option<Comment>,
|
||||||
pub comment_counts: Option<CommentAggregates>,
|
pub comment_counts: Option<CommentAggregates>,
|
||||||
pub comment_saved: bool,
|
pub comment_saved: Option<DateTime<Utc>>,
|
||||||
pub my_comment_vote: Option<i16>,
|
pub my_comment_vote: Option<i16>,
|
||||||
pub subscribed: SubscribedType,
|
pub subscribed: SubscribedType,
|
||||||
pub item_creator: Person,
|
pub item_creator: Person,
|
||||||
|
|
Loading…
Reference in a new issue