use crate::{
newtypes::{PersonId, PostReportId},
- schema::post_report::dsl::*,
- source::post_report::*,
+ schema::post_report::dsl::{post_report, resolved, resolver_id, updated},
+ source::post_report::{PostReport, PostReportForm},
traits::Reportable,
utils::{get_conn, naive_now, DbPool},
};
-use diesel::{dsl::*, result::Error, ExpressionMethods, QueryDsl};
+use diesel::{
+ dsl::{insert_into, update},
+ result::Error,
+ ExpressionMethods,
+ QueryDsl,
+};
use diesel_async::RunQueryDsl;
#[async_trait]
type Form = PostReportForm;
type IdType = PostReportId;
- async fn report(pool: &DbPool, post_report_form: &PostReportForm) -> Result<Self, Error> {
+ async fn report(pool: &mut DbPool<'_>, post_report_form: &PostReportForm) -> Result<Self, Error> {
let conn = &mut get_conn(pool).await?;
insert_into(post_report)
.values(post_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> {