feat: implement user follow/unfollow functionality and thought retrieval by user
- Added follow and unfollow endpoints for users. - Implemented logic to retrieve thoughts by a specific user. - Updated user error handling to include cases for already following and not following. - Created persistence layer for follow relationships. - Enhanced user and thought schemas to support new features. - Added tests for follow/unfollow endpoints and thought retrieval. - Updated frontend to display thoughts and allow posting new thoughts.
This commit is contained in:
@@ -5,14 +5,14 @@ use crate::domains::user;
|
||||
|
||||
#[derive(Serialize, ToSchema)]
|
||||
pub struct UserSchema {
|
||||
pub id: u32,
|
||||
pub id: i32,
|
||||
pub username: String,
|
||||
}
|
||||
|
||||
impl From<user::Model> for UserSchema {
|
||||
fn from(user: user::Model) -> Self {
|
||||
Self {
|
||||
id: user.id as u32,
|
||||
id: user.id,
|
||||
username: user.username,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user