feat(otter): add working user removal route
This commit is contained in:
parent
b946e1ce98
commit
5017bd1c5f
4 changed files with 35 additions and 0 deletions
|
|
@ -81,6 +81,16 @@ impl gpodder::GpodderAuthStore for SqliteRepository {
|
|||
.map_err(DbError::from)?)
|
||||
}
|
||||
|
||||
fn remove_user(&self, id: i64) -> Result<bool, AuthErr> {
|
||||
let conn = &mut self.pool.get().map_err(DbError::from)?;
|
||||
|
||||
match diesel::delete(users::table.filter(users::id.eq(id))).execute(conn) {
|
||||
Ok(0) => Ok(false),
|
||||
Ok(_) => Ok(true),
|
||||
Err(err) => Err(DbError::from(err).into()),
|
||||
}
|
||||
}
|
||||
|
||||
fn get_session(&self, session_id: i64) -> Result<Option<gpodder::models::Session>, AuthErr> {
|
||||
match sessions::table
|
||||
.inner_join(users::table)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue