feat: ✨ admin routing part 2
This commit is contained in:
parent
a462d3a82d
commit
bf2b0a439c
13 changed files with 370 additions and 171 deletions
|
@ -1,15 +1,19 @@
|
|||
pub mod contact;
|
||||
pub mod role;
|
||||
pub mod user;
|
||||
pub mod user_contact;
|
||||
|
||||
use axum::Router;
|
||||
|
||||
use super::middleware::pass_builder_or_admin_by_authorization_token;
|
||||
use super::middleware::builder_or_admin_by_authorization_token;
|
||||
|
||||
pub fn route() -> Router {
|
||||
Router::new()
|
||||
.nest("/users", user::route())
|
||||
.nest("/roles", role::route())
|
||||
.nest("/contacts", contact::route())
|
||||
.nest("/user_contacts", user_contact::route())
|
||||
.route_layer(axum::middleware::from_fn(
|
||||
pass_builder_or_admin_by_authorization_token,
|
||||
builder_or_admin_by_authorization_token,
|
||||
))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue