Skip to main content

tuwunel_api/client/admin/
is_user_suspended.rs

1use axum::extract::State;
2use ruma::api::client::admin::is_user_suspended;
3use tuwunel_core::Result;
4
5use super::authorize;
6use crate::Ruma;
7
8/// # `GET /_matrix/client/v1/admin/suspend/{userId}`
9pub(crate) async fn is_user_suspended_route(
10	State(services): State<crate::State>,
11	body: Ruma<is_user_suspended::v1::Request>,
12) -> Result<is_user_suspended::v1::Response> {
13	let user_id = &body.user_id;
14
15	authorize(&services, body.sender_user(), user_id).await?;
16
17	Ok(is_user_suspended::v1::Response::new(services.users.is_suspended(user_id).await))
18}