forked from jmug/stoatchat
refactor: capture errors with line numbers
refactor: update file api
This commit is contained in:
@@ -142,7 +142,7 @@ pub async fn edit(
|
||||
|
||||
// 2. Apply new avatar
|
||||
if let Some(avatar) = avatar {
|
||||
partial.avatar = Some(File::use_avatar(db, &avatar, &user.id).await?);
|
||||
partial.avatar = Some(File::use_user_avatar(db, &avatar, &user.id, &user.id).await?);
|
||||
}
|
||||
|
||||
member
|
||||
|
||||
@@ -138,13 +138,13 @@ pub async fn edit(
|
||||
|
||||
// 3. Apply new icon
|
||||
if let Some(icon) = icon {
|
||||
partial.icon = Some(File::use_server_icon(db, &icon, &server.id).await?);
|
||||
partial.icon = Some(File::use_server_icon(db, &icon, &server.id, &user.id).await?);
|
||||
server.icon = partial.icon.clone();
|
||||
}
|
||||
|
||||
// 4. Apply new banner
|
||||
if let Some(banner) = banner {
|
||||
partial.banner = Some(File::use_banner(db, &banner, &server.id).await?);
|
||||
partial.banner = Some(File::use_server_banner(db, &banner, &server.id, &user.id).await?);
|
||||
server.banner = partial.banner.clone();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user