mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
feat: implemente delete account for postgres via sqlx
This commit is contained in:
@@ -129,6 +129,15 @@ impl MCDatabase for Database {
|
|||||||
res.map_err(map_register_err)?;
|
res.map_err(map_register_err)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// delete a user
|
||||||
|
async fn delete_user(&self, username: &str) -> DBResult<()> {
|
||||||
|
sqlx::query!("DELETE FROM mcaptcha_users WHERE name = ($1)", username)
|
||||||
|
.execute(&self.pool)
|
||||||
|
.await
|
||||||
|
.map_err(map_register_err)?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn now_unix_time_stamp() -> i64 {
|
fn now_unix_time_stamp() -> i64 {
|
||||||
|
|||||||
Reference in New Issue
Block a user