Some changes
This commit is contained in:
2 files changed
+2
-14
No files matched your search
@@ -417,6 +417,7 @@ pub mod endpoint {
|
||||
) -> (axum::http::StatusCode, axum::Json<super::response::get_user_profile::GetUserProfileResponse>) {
|
||||
let mut response = super::response::get_user_profile::GetUserProfileResponse::default();
|
||||
if id.is_nil() {
|
||||
response.message = "Invalid request".to_string();
|
||||
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
|
||||
} else {
|
||||
match repo::user::get_with_id(&pool, &id).await {
|
||||
|
||||
+1
-14
@@ -24,20 +24,7 @@ pub mod user {
|
||||
|
||||
match result {
|
||||
Ok(r) => match r {
|
||||
Some(r) => Ok(simodels::user::User {
|
||||
id: r.try_get("id")?,
|
||||
username: r.try_get("username")?,
|
||||
password: r.try_get("password")?,
|
||||
email: r.try_get("email")?,
|
||||
email_verified: r.try_get("email_verified")?,
|
||||
phone: r.try_get("phone")?,
|
||||
salt_id: r.try_get("salt_id")?,
|
||||
firstname: r.try_get("firstname")?,
|
||||
lastname: r.try_get("lastname")?,
|
||||
date_created: r.try_get("date_created")?,
|
||||
last_login: r.try_get("last_login")?,
|
||||
status: r.try_get("status")?,
|
||||
}),
|
||||
Some(r) => parse_row(&r).await,
|
||||
None => Err(sqlx::Error::RowNotFound),
|
||||
},
|
||||
Err(e) => Err(e),
|
||||
|
||||
Reference in new issue
Block a user