Fix more clippy issues, implement forgot password
All checks were successful
Build Crate / build (push) Successful in 1m48s

This commit is contained in:
2024-08-28 23:03:52 -04:00
parent 1faaf65aad
commit ed780c9585
15 changed files with 181 additions and 49 deletions

View File

@@ -71,11 +71,16 @@ pub async fn post_register_user(
forgot_password_request: Set(None),
..Default::default()
};
// TODO -> error handling
let db_resp = user::Entity::insert(new_user)
.exec(&state.db_conn)
.await
.unwrap();
let db_resp = user::Entity::insert(new_user).exec(&state.db_conn).await;
match db_resp {
Ok(_) => {}
Err(err) => {
return (
StatusCode::INTERNAL_SERVER_ERROR,
Json(GenericResponse::err(err.to_string().as_str())),
);
}
};
return (StatusCode::OK, Json(GenericResponse::ok()));
}