style: format seluruh workspace dengan cargo fmt
Menyeragamkan format kode sesuai rustfmt (126 file). Sebelumnya lefthook pre-commit 'cargo fmt --check' akan gagal pada commit apa pun.
This commit is contained in:
@@ -31,8 +31,8 @@ pub mod state;
|
||||
pub use error::ApiError;
|
||||
pub use state::ApiState;
|
||||
|
||||
use std::sync::Arc;
|
||||
use axum::Router;
|
||||
use std::sync::Arc;
|
||||
use tower_http::cors::CorsLayer;
|
||||
|
||||
/// Build the API router with all routes registered.
|
||||
@@ -64,10 +64,7 @@ pub fn build_router(state: ApiState) -> Router {
|
||||
Router::new()
|
||||
.nest("/api/v1/auth", auth_router())
|
||||
.nest("/api/v1/health", health_router())
|
||||
.nest(
|
||||
"/api/v1",
|
||||
protected_router().layer(jwt_auth),
|
||||
)
|
||||
.nest("/api/v1", protected_router().layer(jwt_auth))
|
||||
.layer(cors)
|
||||
.with_state(shared_state)
|
||||
}
|
||||
@@ -89,7 +86,10 @@ fn protected_router() -> Router<Arc<ApiState>> {
|
||||
let sessions_router = Router::new()
|
||||
.route("/", axum::routing::get(sessions::list_sessions_handler))
|
||||
.route("/", axum::routing::post(sessions::create_session_handler))
|
||||
.route("/{id}", axum::routing::delete(sessions::delete_session_handler))
|
||||
.route(
|
||||
"/{id}",
|
||||
axum::routing::delete(sessions::delete_session_handler),
|
||||
)
|
||||
// Conversations are sub-resources of sessions
|
||||
.route(
|
||||
"/{id}/conversations",
|
||||
|
||||
Reference in New Issue
Block a user