summaryrefslogtreecommitdiffstats
path: root/src/models
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2022-09-13 14:02:35 +0000
committerSanto Cariotti <santo@dcariotti.me>2022-09-13 14:02:35 +0000
commitf3aa3792255652371ceea6ec032c8962061eb3dc (patch)
treeb6c5e377e5801473462520f77a7137f1bcc74f6d /src/models
parentd7ad64ab7b779886af75d2500365372921c9181e (diff)
Add endpoint to delete avatar
Diffstat (limited to 'src/models')
-rw-r--r--src/models/user.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/models/user.rs b/src/models/user.rs
index 7d336f9..fee6522 100644
--- a/src/models/user.rs
+++ b/src/models/user.rs
@@ -171,7 +171,7 @@ impl User {
impl UserList {
// Edit an user
- pub async fn edit_avatar(&mut self, avatar: String) -> Result<(), AppError> {
+ pub async fn edit_avatar(&mut self, avatar: Option<String>) -> Result<(), AppError> {
let pool = unsafe { get_client() };
sqlx::query!(
r#"
@@ -183,7 +183,7 @@ impl UserList {
.execute(pool)
.await?;
- self.avatar = Some(avatar);
+ self.avatar = avatar;
Ok(())
}