Added favicons and shit like this.
This commit is contained in:
1 parent
76e1e8cb53
commit
1b94784c7f
18 files changed
+163
-22
No files matched your search
@@ -2,7 +2,7 @@ use rusqlite::Connection;
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::db::users::{list_users, User};
|
||||
use crate::db::users::{get_user_by_name, list_users, User};
|
||||
use crate::util::CustomResult;
|
||||
|
||||
#[derive(Serialize, Debug)]
|
||||
@@ -28,10 +28,10 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug)]
|
||||
#[derive(Deserialize, Serialize, Debug, Clone)]
|
||||
pub struct UserDTO {
|
||||
name: String,
|
||||
id: String, // todo: should be of type UserId
|
||||
pub name: String,
|
||||
pub id: String, // todo: should be of type UserId
|
||||
}
|
||||
|
||||
impl UserDTO {
|
||||
@@ -52,6 +52,11 @@ impl UserService<'_> {
|
||||
UserService { conn }
|
||||
}
|
||||
|
||||
pub fn get_user_for_authentication(&self, username: &String, _credentials: &String) -> CustomResult<Option<UserDTO>> {
|
||||
let ret = get_user_by_name(self.conn, username)?;
|
||||
Ok(ret.as_ref().map(UserDTO::from_entity))
|
||||
}
|
||||
|
||||
pub fn list_users(self) -> CustomResult<Page<UserDTO>> {
|
||||
let users = list_users(self.conn)?
|
||||
.iter()
|
||||
|
||||
Reference in new issue
Block a user