pub async fn edit_message_reply(
    class_id: i32,
    message_reply_id: i32,
    _message_id: i32,
    conn: Database,
    auth: AuthCookie,
) -> Html {
    use crate::schema::class_message_reply::dsl as class_message_reply;
    match conn
        .run(move |c| {
            class_message_reply::class_message_reply
                .filter(class_message_reply::user_id.eq(auth.0))
                .filter(class_message_reply::class_id.eq(class_id))
                .filter(class_message_reply::id.eq(message_reply_id))
                .first::<ClassMessageReply>(c)
        })
        .await
    {
        Ok(msg) => Html::default()
            .head(default_head("Edit message".to_string()))
            .body(
                Body::default()
                    .child(H1::new("Edit your reply"))
                    .child(edit_message_reply_form(&msg)),
            ),
        Err(e) => {
            error!("Error rendering message reply edit form: {:#?}", e);
            database_error()
        }
    }
}
/// This _message_id is here as a placeholder (it is later used when returning a redirect after POST
/// request to the same location)
This _message_id is here as a placeholder (it is later used when returning a redirect after POST
request to the same location)
This _message_id is here as a placeholder ( it is later used when returning a redirect after POST request to the same location )
pub async fn edit_message_reply(
    class_id: i32,
    message_reply_id: i32,
    _message_id: i32,
    conn: Database,
    auth: AuthCookie,
) -> Html {
    use crate::schema::class_message_reply::dsl as class_message_reply;
    match conn
        .run(move |c| {
            class_message_reply::class_message_reply
                .filter(class_message_reply::user_id.eq(auth.0))
                .filter(class_message_reply::class_id.eq(class_id))
                .filter(class_message_reply::id.eq(message_reply_id))
                .first::<ClassMessageReply>(c)
        })
        .await
    {
        Ok(msg) => Html::default()
            .head(default_head("Edit message".to_string()))
            .body(
                Body::default()
                    .child(H1::new("Edit your reply"))
                    .child(edit_message_reply_form(&msg)),
            ),
        Err(e) => {
            error!("Error rendering message reply edit form: {:#?}", e);
            database_error()
        }
    }
}
pub async fn edit_message_reply ( class_id : i32 , message_reply_id : i32 , _message_id : i32 , conn : Database , auth : AuthCookie , ) -> Html { use crate :: schema :: class_message_reply :: dsl as class_message_reply ; match conn . run ( move | c | { class_message_reply :: class_message_reply . filter ( class_message_reply :: user_id . eq ( auth . 0 ) ) . filter ( class_message_reply :: class_id . eq ( class_id ) ) . filter ( class_message_reply :: id . eq ( message_reply_id ) ) . first :: < ClassMessageReply > ( c ) } ) . await { Ok ( msg ) => Html :: default ( ) . head ( default_head ( " " . to_string ( ) ) ) . body ( Body :: default ( ) . child ( H1 :: new ( " " ) ) . child ( edit_message_reply_form ( & msg ) ) , ) , Err ( e ) => { error ! ( " " e ) ; database_error ( ) } } }
This _message_id is here as a placeholder (it is later used when returning a redirect after POST
request to the same location)
This _message_id is here as a placeholder ( it is later used when returning a redirect after POST request to the same location )
class_id
i32
message_reply_id
i32
_message_id
i32
conn
Database
auth
AuthCookie