summaryrefslogtreecommitdiffstats
path: root/server/src/db/user.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/db/user.rs')
-rw-r--r--server/src/db/user.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/server/src/db/user.rs b/server/src/db/user.rs
index 0c083296..a37e19c4 100644
--- a/server/src/db/user.rs
+++ b/server/src/db/user.rs
@@ -20,6 +20,7 @@ pub struct User_ {
pub published: chrono::NaiveDateTime,
pub updated: Option<chrono::NaiveDateTime>,
pub show_nsfw: bool,
+ pub theme: String,
}
#[derive(Insertable, AsChangeset, Clone)]
@@ -34,6 +35,7 @@ pub struct UserForm {
pub email: Option<String>,
pub updated: Option<chrono::NaiveDateTime>,
pub show_nsfw: bool,
+ pub theme: String,
}
impl Crud<UserForm> for User_ {
@@ -74,6 +76,7 @@ pub struct Claims {
pub username: String,
pub iss: String,
pub show_nsfw: bool,
+ pub theme: String,
}
impl Claims {
@@ -94,6 +97,7 @@ impl User_ {
username: self.name.to_owned(),
iss: self.fedi_name.to_owned(),
show_nsfw: self.show_nsfw,
+ theme: self.theme.to_owned(),
};
encode(
&Header::default(),
@@ -141,6 +145,7 @@ mod tests {
banned: false,
updated: None,
show_nsfw: false,
+ theme: "darkly".into(),
};
let inserted_user = User_::create(&conn, &new_user).unwrap();
@@ -158,6 +163,7 @@ mod tests {
published: inserted_user.published,
updated: None,
show_nsfw: false,
+ theme: "darkly".into(),
};
let read_user = User_::read(&conn, inserted_user.id).unwrap();