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:
@@ -19,3 +19,15 @@ pub async fn make_post_request(app: Router, url: &str, body: String) -> Response
|
||||
.await
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
pub async fn make_delete_request(app: Router, url: &str) -> Response {
|
||||
app.oneshot(
|
||||
Request::builder()
|
||||
.method("DELETE")
|
||||
.uri(url)
|
||||
.body(Body::empty())
|
||||
.unwrap(),
|
||||
)
|
||||
.await
|
||||
.unwrap()
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
mod api;
|
||||
mod db;
|
||||
|
||||
pub use api::{make_get_request, make_post_request};
|
||||
pub use api::{make_delete_request, make_get_request, make_post_request};
|
||||
pub use db::setup_test_db;
|
||||
|
Reference in New Issue
Block a user