mirror of https://github.com/LemmyNet/lemmy.git
Remove Crud::delete definitions that match default
parent
c37cd3ccd9
commit
9f47fcbe87
|
@ -157,11 +157,6 @@ impl Crud for Comment {
|
|||
type UpdateForm = CommentUpdateForm;
|
||||
type IdType = CommentId;
|
||||
|
||||
async fn delete(pool: &mut DbPool<'_>, comment_id: CommentId) -> Result<usize, Error> {
|
||||
let conn = &mut get_conn(pool).await?;
|
||||
diesel::delete(comment.find(comment_id)).execute(conn).await
|
||||
}
|
||||
|
||||
/// This is unimplemented, use [[Comment::create]]
|
||||
async fn create(_pool: &mut DbPool<'_>, _comment_form: &Self::InsertForm) -> Result<Self, Error> {
|
||||
unimplemented!();
|
||||
|
|
|
@ -28,13 +28,6 @@ impl Crud for Community {
|
|||
type UpdateForm = CommunityUpdateForm;
|
||||
type IdType = CommunityId;
|
||||
|
||||
async fn delete(pool: &mut DbPool<'_>, community_id: CommunityId) -> Result<usize, Error> {
|
||||
let conn = &mut get_conn(pool).await?;
|
||||
diesel::delete(community::table.find(community_id))
|
||||
.execute(conn)
|
||||
.await
|
||||
}
|
||||
|
||||
async fn create(pool: &mut DbPool<'_>, form: &Self::InsertForm) -> Result<Self, Error> {
|
||||
let is_new_community = match &form.actor_id {
|
||||
Some(id) => Community::read_from_apub_id(pool, id).await?.is_none(),
|
||||
|
|
|
@ -70,12 +70,6 @@ impl Crud for LocalUser {
|
|||
type UpdateForm = LocalUserUpdateForm;
|
||||
type IdType = LocalUserId;
|
||||
|
||||
async fn delete(pool: &mut DbPool<'_>, local_user_id: LocalUserId) -> Result<usize, Error> {
|
||||
let conn = &mut get_conn(pool).await?;
|
||||
diesel::delete(local_user.find(local_user_id))
|
||||
.execute(conn)
|
||||
.await
|
||||
}
|
||||
async fn create(pool: &mut DbPool<'_>, form: &Self::InsertForm) -> Result<Self, Error> {
|
||||
let conn = &mut get_conn(pool).await?;
|
||||
let mut form_with_encrypted_password = form.clone();
|
||||
|
|
|
@ -28,12 +28,6 @@ impl Crud for Person {
|
|||
.await
|
||||
}
|
||||
|
||||
async fn delete(pool: &mut DbPool<'_>, person_id: PersonId) -> Result<usize, Error> {
|
||||
let conn = &mut get_conn(pool).await?;
|
||||
diesel::delete(person::table.find(person_id))
|
||||
.execute(conn)
|
||||
.await
|
||||
}
|
||||
async fn create(pool: &mut DbPool<'_>, form: &PersonInsertForm) -> Result<Self, Error> {
|
||||
let conn = &mut get_conn(pool).await?;
|
||||
insert_into(person::table)
|
||||
|
|
|
@ -39,11 +39,6 @@ impl Crud for Post {
|
|||
type UpdateForm = PostUpdateForm;
|
||||
type IdType = PostId;
|
||||
|
||||
async fn delete(pool: &mut DbPool<'_>, post_id: PostId) -> Result<usize, Error> {
|
||||
let conn = &mut get_conn(pool).await?;
|
||||
diesel::delete(post.find(post_id)).execute(conn).await
|
||||
}
|
||||
|
||||
async fn create(pool: &mut DbPool<'_>, form: &Self::InsertForm) -> Result<Self, Error> {
|
||||
let conn = &mut get_conn(pool).await?;
|
||||
insert_into(post)
|
||||
|
|
|
@ -38,12 +38,6 @@ impl Crud for PrivateMessage {
|
|||
.get_result::<Self>(conn)
|
||||
.await
|
||||
}
|
||||
async fn delete(pool: &mut DbPool<'_>, pm_id: Self::IdType) -> Result<usize, Error> {
|
||||
let conn = &mut get_conn(pool).await?;
|
||||
diesel::delete(private_message.find(pm_id))
|
||||
.execute(conn)
|
||||
.await
|
||||
}
|
||||
}
|
||||
|
||||
impl PrivateMessage {
|
||||
|
|
|
@ -37,13 +37,6 @@ impl Crud for RegistrationApplication {
|
|||
.get_result::<Self>(conn)
|
||||
.await
|
||||
}
|
||||
|
||||
async fn delete(pool: &mut DbPool<'_>, id_: Self::IdType) -> Result<usize, Error> {
|
||||
let conn = &mut get_conn(pool).await?;
|
||||
diesel::delete(registration_application.find(id_))
|
||||
.execute(conn)
|
||||
.await
|
||||
}
|
||||
}
|
||||
|
||||
impl RegistrationApplication {
|
||||
|
|
|
@ -72,11 +72,6 @@ impl Crud for Site {
|
|||
.get_result::<Self>(conn)
|
||||
.await
|
||||
}
|
||||
|
||||
async fn delete(pool: &mut DbPool<'_>, site_id: SiteId) -> Result<usize, Error> {
|
||||
let conn = &mut get_conn(pool).await?;
|
||||
diesel::delete(site.find(site_id)).execute(conn).await
|
||||
}
|
||||
}
|
||||
|
||||
impl Site {
|
||||
|
|
Loading…
Reference in New Issue