pub fn archive_thread(thread_uuid: ThreadUuid, conn: &PgConnection) -> BackendResult<MinimalThreadData> {
        use crate::schema::threads::{
            self,
            dsl::*,
        };

        let m_thread_uuid: Uuid = thread_uuid.0;

        let thread: Thread = diesel::update(threads::table)
            .filter(threads::uuid.eq(m_thread_uuid))
            .set(archived.eq(true))
            .get_result(conn)
            .map_err(handle_err::<Thread>)?;
        let author_uuid_a = UserUuid(thread.author_uuid);
        let user: User = User::get_user(author_uuid_a, conn)?;

        Ok(MinimalThreadData { thread, user })
    }
/// Archives the thread, preventing it from being seen in typical requests.
///
/// The thread _must_ also be locked in order to not be modifiable.
Archives the thread, preventing it from being seen in typical requests.
The thread _must_ also be locked in order to not be modifiable.
Archives the thread preventing it from being seen in typical requests . The thread _must_ also be locked in order to not be modifiable .
pub fn archive_thread(thread_uuid: ThreadUuid, conn: &PgConnection) -> BackendResult<MinimalThreadData> {
        use crate::schema::threads::{
            self,
            dsl::*,
        };
        let m_thread_uuid: Uuid = thread_uuid.0;
        let thread: Thread = diesel::update(threads::table)
            .filter(threads::uuid.eq(m_thread_uuid))
            .set(archived.eq(true))
            .get_result(conn)
            .map_err(handle_err::<Thread>)?;
        let author_uuid_a = UserUuid(thread.author_uuid);
        let user: User = User::get_user(author_uuid_a, conn)?;
        Ok(MinimalThreadData { thread, user })
    }
pub fn archive_thread ( thread_uuid : ThreadUuid , conn : & PgConnection ) -> BackendResult < MinimalThreadData > { use crate :: schema :: threads :: { self , dsl :: * , } ; let m_thread_uuid : Uuid = thread_uuid . 0 ; let thread : Thread = diesel :: update ( threads :: table ) . filter ( threads :: uuid . eq ( m_thread_uuid ) ) . set ( archived . eq ( true ) ) . get_result ( conn ) . map_err ( handle_err :: < Thread > ) ? ; let author_uuid_a = UserUuid ( thread . author_uuid ) ; let user : User = User :: get_user ( author_uuid_a , conn ) ? ; Ok ( MinimalThreadData { thread , user } ) }
Archives the thread, preventing it from being seen in typical requests.
Archives the thread preventing it from being seen in typical requests .
thread_uuid
ThreadUuid
conn
&PgConnection
thread_uuid
ThreadUuid
conn
&PgConnection