impl Tagline {
pub async fn replace(
- pool: &DbPool,
+ pool: &mut DbPool<'_>,
for_local_site_id: LocalSiteId,
list_content: Option<Vec<String>>,
) -> Result<Vec<Self>, Error> {
.get_result::<Self>(conn)
.await?;
}
- Self::get_all_conn(conn, for_local_site_id).await
+ Self::get_all(&mut conn.into(), for_local_site_id).await
}) as _
})
.await
} else {
- Self::get_all_conn(conn, for_local_site_id).await
+ Self::get_all(&mut conn.into(), for_local_site_id).await
}
}
diesel::delete(tagline).execute(conn).await
}
- async fn get_all_conn(
- conn: &mut AsyncPgConnection,
+ pub async fn get_all(
+ pool: &mut DbPool<'_>,
for_local_site_id: LocalSiteId,
) -> Result<Vec<Self>, Error> {
+ let conn = &mut get_conn(pool).await?;
tagline
.filter(local_site_id.eq(for_local_site_id))
.get_results::<Self>(conn)
.await
}
- pub async fn get_all(pool: &DbPool, for_local_site_id: LocalSiteId) -> Result<Vec<Self>, Error> {
- let conn = &mut get_conn(pool).await?;
- Self::get_all_conn(conn, for_local_site_id).await
- }
}