chore: detach emojis on delete

This commit is contained in:
Paul Makles
2022-07-15 14:01:59 +01:00
parent 4f73e43a03
commit d96c9f62c4
6 changed files with 33 additions and 10 deletions

View File

@@ -9,6 +9,7 @@ impl Emoji {
fn parent(&self) -> &str {
match &self.parent {
EmojiParent::Server { id } => id,
EmojiParent::Detached => "",
}
}
@@ -30,7 +31,6 @@ impl Emoji {
.p(self.parent().to_string())
.await;
db.mark_attachment_as_deleted(&self.id).await?;
db.delete_emoji(&self).await
db.detach_emoji(&self).await
}
}