use crate::{
newtypes::{PersonId, PrivateMessageReportId},
- schema::private_message_report::dsl::*,
+ schema::private_message_report::dsl::{private_message_report, resolved, resolver_id, updated},
source::private_message_report::{PrivateMessageReport, PrivateMessageReportForm},
traits::Reportable,
utils::{get_conn, naive_now, DbPool},
};
-use diesel::{dsl::*, result::Error, *};
+use diesel::{
+ dsl::{insert_into, update},
+ result::Error,
+ ExpressionMethods,
+ QueryDsl,
+};
use diesel_async::RunQueryDsl;
#[async_trait]
type Form = PrivateMessageReportForm;
type IdType = PrivateMessageReportId;
- async fn report(pool: &DbPool, pm_report_form: &PrivateMessageReportForm) -> Result<Self, Error> {
+ async fn report(
+ pool: &mut DbPool<'_>,
+ pm_report_form: &PrivateMessageReportForm,
+ ) -> Result<Self, Error> {
let conn = &mut get_conn(pool).await?;
insert_into(private_message_report)
.values(pm_report_form)
}
async fn resolve(
- pool: &DbPool,
+ pool: &mut DbPool<'_>,
report_id: Self::IdType,
by_resolver_id: PersonId,
) -> Result<usize, Error> {
}
async fn unresolve(
- pool: &DbPool,
+ pool: &mut DbPool<'_>,
report_id: Self::IdType,
by_resolver_id: PersonId,
) -> Result<usize, Error> {