remove debug log for post creation

This commit is contained in:
Felix Ableitner 2020-04-07 19:13:33 +02:00
parent cca3a52856
commit eab4edc246

View file

@ -111,13 +111,11 @@ impl Crud<PostForm> for Post {
fn create(conn: &PgConnection, new_post: &PostForm) -> Result<Self, Error> { fn create(conn: &PgConnection, new_post: &PostForm) -> Result<Self, Error> {
use crate::schema::post::dsl::*; use crate::schema::post::dsl::*;
dbg!(&new_post);
insert_into(post).values(new_post).get_result::<Self>(conn) insert_into(post).values(new_post).get_result::<Self>(conn)
} }
fn update(conn: &PgConnection, post_id: i32, new_post: &PostForm) -> Result<Self, Error> { fn update(conn: &PgConnection, post_id: i32, new_post: &PostForm) -> Result<Self, Error> {
use crate::schema::post::dsl::*; use crate::schema::post::dsl::*;
dbg!(&new_post);
diesel::update(post.find(post_id)) diesel::update(post.find(post_id))
.set(new_post) .set(new_post)
.get_result::<Self>(conn) .get_result::<Self>(conn)