pub async fn put_password(username: String, password: UpdatePassword, db: PostgresDbConn) -> ResponseWithStatus {
    db.run(move |conn| {
        if User::update_password(username, password, conn) {
            ResponseWithStatus::with(Status::Ok.code, constants::MESSAGE_UPDATE_SUCCESS)
        } else {
            ResponseWithStatus::with(Status::BadRequest.code, constants::MESSAGE_UPDATE_FAILED)
        }
    }).await
}
/// Attempts to update the user's password to the new value in `password` (hashed of course) for the user
/// with the given `username`.
Attempts to update the user's password to the new value in `password` (hashed of course) for the user
with the given `username`.
Attempts to update the user ' s password to the new value in ` password ` ( hashed of course ) for the user with the given ` username ` .
pub async fn put_password(username: String, password: UpdatePassword, db: PostgresDbConn) -> ResponseWithStatus {
    db.run(move |conn| {
        if User::update_password(username, password, conn) {
            ResponseWithStatus::with(Status::Ok.code, constants::MESSAGE_UPDATE_SUCCESS)
        } else {
            ResponseWithStatus::with(Status::BadRequest.code, constants::MESSAGE_UPDATE_FAILED)
        }
    }).await
}
pub async fn put_password ( username : String , password : UpdatePassword , db : PostgresDbConn ) -> ResponseWithStatus { db . run ( move | conn | { if User :: update_password ( username , password , conn ) { ResponseWithStatus :: with ( Status :: Ok . code , constants :: MESSAGE_UPDATE_SUCCESS ) } else { ResponseWithStatus :: with ( Status :: BadRequest . code , constants :: MESSAGE_UPDATE_FAILED ) } } ) . await }
Attempts to update the user's password to the new value in `password` (hashed of course) for the user
with the given `username`.
Attempts to update the user ' s password to the new value in ` password ` ( hashed of course ) for the user with the given ` username ` .
username
String
password
UpdatePassword
db
PostgresDbConn
username
String
password
UpdatePassword
db
PostgresDbConn