This commit is contained in:
Felix Ableitner 2024-09-16 15:32:21 +02:00
parent ee945fec98
commit 876346781b

View file

@ -55,13 +55,14 @@ impl Crud for Post {
} }
/// Ignores unpublished scheduled posts /// Ignores unpublished scheduled posts
async fn read( async fn read(pool: &mut DbPool<'_>, id: Self::IdType) -> Result<Option<Self>, Error> {
pool: &mut DbPool<'_>
, id: Self::IdType
) -> Result<Option<Self>, Error> {
let conn = &mut *get_conn(pool).await?; let conn = &mut *get_conn(pool).await?;
post::table.find(id) post::table
.filter(post::scheduled_time.is_null()).first(conn).await.optional() .find(id)
.filter(post::scheduled_time.is_null())
.first(conn)
.await
.optional()
} }
async fn update( async fn update(