tsk-55: Register endpoint bug fix (#72)
All checks were successful
Release Tagging / release (push) Successful in 32s
Rust Build / Check (push) Successful in 41s
Rust Build / Test Suite (push) Successful in 1m7s
Rust Build / Rustfmt (push) Successful in 35s
Rust Build / Clippy (push) Successful in 40s
Rust Build / build (push) Successful in 57s
All checks were successful
Release Tagging / release (push) Successful in 32s
Rust Build / Check (push) Successful in 41s
Rust Build / Test Suite (push) Successful in 1m7s
Rust Build / Rustfmt (push) Successful in 35s
Rust Build / Clippy (push) Successful in 40s
Rust Build / build (push) Successful in 57s
Closes #55 Reviewed-on: #72 Co-authored-by: phoenix <kundeng00@pm.me> Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
@@ -94,7 +94,7 @@ pub mod user {
|
||||
pub async fn insert(
|
||||
pool: &sqlx::PgPool,
|
||||
user: &icarus_models::user::User,
|
||||
) -> Result<uuid::Uuid, sqlx::Error> {
|
||||
) -> Result<(uuid::Uuid, std::option::Option<time::OffsetDateTime>), sqlx::Error> {
|
||||
let row = sqlx::query(
|
||||
r#"
|
||||
INSERT INTO "user" (username, password, email, phone, firstname, lastname, email_verified, status, salt_id)
|
||||
@@ -124,10 +124,10 @@ pub mod user {
|
||||
.map_err(|_e| sqlx::Error::RowNotFound)?,
|
||||
};
|
||||
|
||||
if !result.id.is_nil() {
|
||||
Ok(result.id)
|
||||
} else {
|
||||
if result.id.is_nil() && result.date_created.is_none() {
|
||||
Err(sqlx::Error::RowNotFound)
|
||||
} else {
|
||||
Ok((result.id, result.date_created))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user