PostUpdateForm,
},
traits::{Crud, Likeable, Readable, Saveable},
- utils::{
- get_conn,
- naive_now,
- DbPool,
- DELETED_REPLACEMENT_TEXT,
- DELETED_REPLACEMENT_URL,
- FETCH_LIMIT_MAX,
- },
+ utils::{get_conn, naive_now, DbPool, DELETED_REPLACEMENT_TEXT, FETCH_LIMIT_MAX},
};
use ::url::Url;
use diesel::{dsl::insert_into, result::Error, ExpressionMethods, QueryDsl, TextExpressionMethods};
diesel::update(post.filter(creator_id.eq(for_creator_id)))
.set((
name.eq(DELETED_REPLACEMENT_TEXT),
- url.eq(DELETED_REPLACEMENT_URL),
+ url.eq(Option::<&str>::None),
body.eq(DELETED_REPLACEMENT_TEXT),
deleted.eq(true),
updated.eq(naive_now()),
}
pub const DELETED_REPLACEMENT_TEXT: &str = "*Permanently Deleted*";
-pub const DELETED_REPLACEMENT_URL: &str = "https://join-lemmy.org/";
impl ToSql<Text, Pg> for DbUrl {
fn to_sql(&self, out: &mut Output<Pg>) -> diesel::serialize::Result {