diff options
| author | Santo Cariotti <santo@dcariotti.me> | 2022-09-13 14:02:35 +0000 |
|---|---|---|
| committer | Santo Cariotti <santo@dcariotti.me> | 2022-09-13 14:02:35 +0000 |
| commit | f3aa3792255652371ceea6ec032c8962061eb3dc (patch) | |
| tree | b6c5e377e5801473462520f77a7137f1bcc74f6d /src/models/user.rs | |
| parent | d7ad64ab7b779886af75d2500365372921c9181e (diff) | |
Add endpoint to delete avatar
Diffstat (limited to 'src/models/user.rs')
| -rw-r--r-- | src/models/user.rs | 4 |
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(()) } |
