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>) {
|
) -> (axum::http::StatusCode, axum::Json<super::response::get_user_profile::GetUserProfileResponse>) {
|
||||||
let mut response = super::response::get_user_profile::GetUserProfileResponse::default();
|
let mut response = super::response::get_user_profile::GetUserProfileResponse::default();
|
||||||
if id.is_nil() {
|
if id.is_nil() {
|
||||||
|
response.message = "Invalid request".to_string();
|
||||||
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
|
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
|
||||||
} else {
|
} else {
|
||||||
match repo::user::get_with_id(&pool, &id).await {
|
match repo::user::get_with_id(&pool, &id).await {
|
||||||
|
|||||||
+1
-14
@@ -24,20 +24,7 @@ pub mod user {
|
|||||||
|
|
||||||
match result {
|
match result {
|
||||||
Ok(r) => match r {
|
Ok(r) => match r {
|
||||||
Some(r) => Ok(simodels::user::User {
|
Some(r) => parse_row(&r).await,
|
||||||
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")?,
|
|
||||||
}),
|
|
||||||
None => Err(sqlx::Error::RowNotFound),
|
None => Err(sqlx::Error::RowNotFound),
|
||||||
},
|
},
|
||||||
Err(e) => Err(e),
|
Err(e) => Err(e),
|
||||||
|
|||||||
Reference in new issue
Block a user