diff --git a/crates/db_schema/src/impls/post.rs b/crates/db_schema/src/impls/post.rs index bf376598c..1f6162152 100644 --- a/crates/db_schema/src/impls/post.rs +++ b/crates/db_schema/src/impls/post.rs @@ -280,12 +280,11 @@ impl Likeable for PostLike { type IdType = PostId; async fn like(pool: &mut DbPool<'_>, post_like_form: &PostLikeForm) -> Result { let conn = &mut get_conn(pool).await?; - let post_like_form = (post_like_form, post_actions::liked.eq(now().nullable())); insert_into(post_actions::table) .values(post_like_form) .on_conflict((post_actions::post_id, post_actions::person_id)) .do_update() - .set(post_like_form) + .set(post_actions::liked.eq(now().nullable())) .returning(Self::as_select()) .get_result::(conn) .await @@ -309,12 +308,11 @@ impl Saveable for PostSaved { type Form = PostSavedForm; async fn save(pool: &mut DbPool<'_>, post_saved_form: &PostSavedForm) -> Result { let conn = &mut get_conn(pool).await?; - let post_saved_form = (post_saved_form, post_actions::saved.eq(now().nullable())); insert_into(post_actions::table) .values(post_saved_form) .on_conflict((post_actions::post_id, post_actions::person_id)) .do_update() - .set(post_saved_form) + .set(post_actions::saved.eq(now().nullable())) .returning(Self::as_select()) .get_result::(conn) .await