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:
@@ -1,15 +1,21 @@
|
||||
use axum::Router;
|
||||
|
||||
pub mod feed;
|
||||
pub mod root;
|
||||
pub mod thought;
|
||||
pub mod user;
|
||||
|
||||
use app::state::AppState;
|
||||
use root::create_root_router;
|
||||
use user::create_user_router;
|
||||
|
||||
use crate::routers::{feed::create_feed_router, thought::create_thought_router};
|
||||
|
||||
pub fn create_router(state: AppState) -> Router {
|
||||
Router::new()
|
||||
.merge(create_root_router())
|
||||
.nest("/users", create_user_router())
|
||||
.nest("/thoughts", create_thought_router())
|
||||
.nest("/feed", create_feed_router())
|
||||
.with_state(state)
|
||||
}
|
||||
|
Reference in New Issue
Block a user