pub fn delete_messages(ids: Vec<i64>, user: &User, room: &Room) -> Result<Response, Rejection> {
    let mut conn = storage::get_conn()?;
    let tx = storage::get_transaction(&mut conn)?;

    for id in ids {
        delete_message(&tx, id, &user, &room)?;
    }

    tx.commit().map_err(db_error)?;

    let json = models::StatusCode { status_code: StatusCode::OK.as_u16() };
    Ok(warp::reply::json(&json).into_response())
}
/// Deletes the messages with the given `ids` from the database, if present.
Deletes the messages with the given `ids` from the database, if present.
Deletes the messages with the given ` ids ` from the database if present .
pub fn delete_messages(ids: Vec<i64>, user: &User, room: &Room) -> Result<Response, Rejection> {
    let mut conn = storage::get_conn()?;
    let tx = storage::get_transaction(&mut conn)?;
    for id in ids {
        delete_message(&tx, id, &user, &room)?;
    }
    tx.commit().map_err(db_error)?;
    let json = models::StatusCode { status_code: StatusCode::OK.as_u16() };
    Ok(warp::reply::json(&json).into_response())
}
pub fn delete_messages ( ids : Vec < i64 > , user : & User , room : & Room ) -> Result < Response , Rejection > { let mut conn = storage :: get_conn ( ) ? ; let tx = storage :: get_transaction ( & mut conn ) ? ; for id in ids { delete_message ( & tx , id , & user , & room ) ? ; } tx . commit ( ) . map_err ( db_error ) ? ; let json = models :: StatusCode { status_code : StatusCode :: OK . as_u16 ( ) } ; Ok ( warp :: reply :: json ( & json ) . into_response ( ) ) }
Deletes the messages with the given `ids` from the database, if present.
Deletes the messages with the given ` ids ` from the database if present .
ids
Vec<i64>
user
&User
room
&Room
ids
Vec<i64>
user
&User
room
&Room