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:
@@ -4,8 +4,10 @@ use validator::Validate;
|
||||
|
||||
#[derive(Deserialize, Validate, ToSchema)]
|
||||
pub struct CreateThoughtParams {
|
||||
pub author_id: i32,
|
||||
|
||||
#[validate(length(min = 1, max = 128))]
|
||||
#[validate(length(
|
||||
min = 1,
|
||||
max = 128,
|
||||
message = "Content must be between 1 and 128 characters"
|
||||
))]
|
||||
pub content: String,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user