-
-
Notifications
You must be signed in to change notification settings - Fork 887
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 person content and person saved tables. #5251
Conversation
* add pagination cursor * store timestamp instead of id in cursor (partial) * Revert "store timestamp instead of id in cursor (partial)" This reverts commit 89359dd. * use paginated query builder
…into combined_tables_2
…into combined_tables_2
- Separating the profile fetch from its combined content fetch. - Starting to separate saved_only into its own combined view.
@@ -184,10 +184,6 @@ impl Saveable for CommentSaved { | |||
comment_saved_form: &CommentSavedForm, | |||
) -> Result<Self, Error> { | |||
let conn = &mut get_conn(pool).await?; | |||
let comment_saved_form = ( | |||
comment_saved_form, | |||
comment_actions::saved.eq(now().nullable()), |
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.
No need to force this, now that I added a default Utc::now()
in the derive_new.
pub trait InternalToCombinedView { | ||
type CombinedView; | ||
|
||
/// Maps the combined DB row to an enum | ||
fn map_to_enum(&self) -> Option<Self::CombinedView>; | ||
} |
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.
Made this into a trait.
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.
Some minor cleanup in this file.
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.
Main changes are in these two files. Its not that important for anyone to read through them, as the joins to build these internal views complicated to read through.
The main thing is that I've added tests to try to catch every case and filter.
.service( | ||
scope("/person") | ||
.route("", get().to(read_person)) | ||
.route("/content", get().to(list_person_content)), | ||
) |
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.
/person/content
seemed like a good place for this new route.
migrations/2024-12-05-233704_add_person_content_combined_table/up.sql
Outdated
Show resolved
Hide resolved
@Nutomic @dullbananas and anyone else who can help review, this one needs to be merged before the other combineds. |
Context #2444
Must come after #5231
Notes:
GetPersonDetails
, into its own paged API action:ListPersonContent
. Seemed strange to get a person's details, moderated communities, and then a paged content fetch.saved_only
option from post and comment views, and created a dedicate API action (ListPersonSaved
) to fetch combined saved content (posts and comments).