feat: add visibility feature to thoughts, including new enum, database migration, and update related endpoints and tests

This commit is contained in:
2025-09-06 17:42:50 +02:00
parent 0abd275946
commit 82c6de8da8
12 changed files with 307 additions and 17 deletions

View File

@@ -24,9 +24,11 @@ async fn feed_get(
auth_user: AuthUser,
) -> Result<impl IntoResponse, ApiError> {
let following_ids = get_following_ids(&state.conn, auth_user.id).await?;
let mut thoughts_with_authors = get_feed_for_user(&state.conn, following_ids).await?;
let mut thoughts_with_authors =
get_feed_for_user(&state.conn, following_ids, Some(auth_user.id)).await?;
let own_thoughts = get_feed_for_user(&state.conn, vec![auth_user.id]).await?;
let own_thoughts =
get_feed_for_user(&state.conn, vec![auth_user.id], Some(auth_user.id)).await?;
thoughts_with_authors.extend(own_thoughts);
let thoughts_schema: Vec<ThoughtSchema> = thoughts_with_authors