pub fn favorite_question(question_uuid: QuestionUuid, user_uuid: UserUuid, conn: &PgConnection) -> BackendResult<()> {
        use crate::schema::junction_favorite_questions_users as favorites;
        let junction_record = NewFavoriteQuestionJunction {
            question_uuid: question_uuid.0,
            user_uuid: user_uuid.0
        };

        diesel::insert_into(favorites::table)
            .values(junction_record)
            .execute(conn)
            .map_err(handle_err::<Question>)?;
        Ok(())
    }
/// Marks a question as a favorite for a given user.
Marks a question as a favorite for a given user.
Marks a question as a favorite for a given user .
pub fn favorite_question(question_uuid: QuestionUuid, user_uuid: UserUuid, conn: &PgConnection) -> BackendResult<()> {
        use crate::schema::junction_favorite_questions_users as favorites;
        let junction_record = NewFavoriteQuestionJunction {
            question_uuid: question_uuid.0,
            user_uuid: user_uuid.0
        };
        diesel::insert_into(favorites::table)
            .values(junction_record)
            .execute(conn)
            .map_err(handle_err::<Question>)?;
        Ok(())
    }
pub fn favorite_question ( question_uuid : QuestionUuid , user_uuid : UserUuid , conn : & PgConnection ) -> BackendResult < ( ) > { use crate :: schema :: junction_favorite_questions_users as favorites ; let junction_record = NewFavoriteQuestionJunction { question_uuid : question_uuid . 0 , user_uuid : user_uuid . 0 } ; diesel :: insert_into ( favorites :: table ) . values ( junction_record ) . execute ( conn ) . map_err ( handle_err :: < Question > ) ? ; Ok ( ( ) ) }
Marks a question as a favorite for a given user.
Marks a question as a favorite for a given user .
question_uuid
QuestionUuid
user_uuid
UserUuid
conn
&PgConnection
question_uuid
QuestionUuid
user_uuid
UserUuid
conn
&PgConnection