mirror of
https://github.com/n08i40k/schedule-parser-rusted.git
synced 2025-12-06 17:57:47 +03:00
feat(users): add endpoints for getting user by ids
This commit is contained in:
17
src/main.rs
17
src/main.rs
@@ -50,7 +50,22 @@ pub fn get_api_scope<
|
||||
.service(routes::auth::sign_up_vk);
|
||||
|
||||
let users_scope = utoipa_actix_web::scope("/users")
|
||||
.wrap(JWTAuthorizationBuilder::new().build())
|
||||
.wrap(
|
||||
JWTAuthorizationBuilder::new()
|
||||
.add_paths(
|
||||
["/by/id/{id}", "/by/telegram-id/{id}"],
|
||||
Some(ServiceConfig {
|
||||
allow_service: true,
|
||||
user_roles: Some(&[UserRole::Admin]),
|
||||
}),
|
||||
)
|
||||
.build(),
|
||||
)
|
||||
.service(
|
||||
utoipa_actix_web::scope("/by")
|
||||
.service(routes::users::by::by_id)
|
||||
.service(routes::users::by::by_telegram_id),
|
||||
)
|
||||
.service(routes::users::change_group)
|
||||
.service(routes::users::change_username)
|
||||
.service(routes::users::me);
|
||||
|
||||
Reference in New Issue
Block a user