Tweaks for the desktop client

This commit is contained in:
2024-08-09 17:02:02 +03:00
parent 8eb5be96b3
commit 1c9bd104e0
33 changed files with 217 additions and 144 deletions

View File

@ -8,11 +8,11 @@ pub struct Params {
type Response = GeneralResult<Json<db::users::UserInfo>>;
pub async fn get(State(pool): State<Pool>, Query(params): Query<Params>) -> Response {
let info = db::users::get(params.user_id, &pool)
db::users::get(params.user_id, &pool)
.await
.handle_internal("Error getting the user")?
.handle(StatusCode::NOT_FOUND, "User not found")?;
Ok(Json(info))
.handle(StatusCode::NOT_FOUND, "User not found")
.map(Json)
}
pub async fn current(state: State<Pool>, claims: Claims) -> Response {