pub async fn signup(user: UserDTO, db: PostgresDbConn) -> ResponseWithStatus {
    db.run(|conn| {
        if User::signup(user, &conn) {
            ResponseWithStatus::with(Status::Ok.code, constants::MESSAGE_SIGNUP_SUCCESS)
        } else {
            ResponseWithStatus::with(Status::BadRequest.code, constants::MESSAGE_SIGNUP_FAILED)
        }
    }).await
}
/// Attempts to signup a new user with the specified user information.
/// If successful, informs the user that the account has been created successfully.
/// If unsuccessful, returns a failed response informing the user.
Attempts to signup a new user with the specified user information.
If successful, informs the user that the account has been created successfully.
If unsuccessful, returns a failed response informing the user.
Attempts to signup a new user with the specified user information . If successful informs the user that the account has been created successfully . If unsuccessful returns a failed response informing the user .
pub async fn signup(user: UserDTO, db: PostgresDbConn) -> ResponseWithStatus {
    db.run(|conn| {
        if User::signup(user, &conn) {
            ResponseWithStatus::with(Status::Ok.code, constants::MESSAGE_SIGNUP_SUCCESS)
        } else {
            ResponseWithStatus::with(Status::BadRequest.code, constants::MESSAGE_SIGNUP_FAILED)
        }
    }).await
}
pub async fn signup ( user : UserDTO , db : PostgresDbConn ) -> ResponseWithStatus { db . run ( | conn | { if User :: signup ( user , & conn ) { ResponseWithStatus :: with ( Status :: Ok . code , constants :: MESSAGE_SIGNUP_SUCCESS ) } else { ResponseWithStatus :: with ( Status :: BadRequest . code , constants :: MESSAGE_SIGNUP_FAILED ) } } ) . await }
Attempts to signup a new user with the specified user information.
Attempts to signup a new user with the specified user information .
user
UserDTO
db
PostgresDbConn
user
UserDTO
db
PostgresDbConn