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

Closes #55

Reviewed-on: #72
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
2025-10-20 16:05:30 +00:00
committed by phoenix
parent 7e44d523f2
commit 6ec3b25e7d
4 changed files with 11 additions and 13 deletions

View File

@@ -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))
}
}
}