feat(channels): implement fetch, edit, delete

This commit is contained in:
Paul Makles
2022-02-04 16:48:32 +00:00
parent 780b88eb2f
commit b58755dbeb
4 changed files with 145 additions and 17 deletions

View File

@@ -44,15 +44,15 @@ pub async fn req(db: &State<Database>, mut user: User, data: Json<Data>) -> Resu
if let Some(fields) = &data.remove {
if fields.contains(&FieldsUser::Avatar) {
if let Some(_avatar) = &user.avatar {
// TODO: delete the avatar
if let Some(avatar) = &user.avatar {
db.mark_attachment_as_deleted(&avatar.id).await?;
}
}
if fields.contains(&FieldsUser::ProfileBackground) {
if let Some(profile) = &user.profile {
if let Some(_background) = &profile.background {
// TODO: delete the background
if let Some(background) = &profile.background {
db.mark_attachment_as_deleted(&background.id).await?;
}
}
}