schema::local_user::dsl::*,
source::local_user::{LocalUser, LocalUserForm},
LocalUserId,
- PersonId,
};
mod safe_settings_type {
id,
person_id,
email,
- admin,
show_nsfw,
theme,
default_sort_type,
id,
person_id,
email,
- admin,
show_nsfw,
theme,
default_sort_type,
local_user_id: LocalUserId,
new_password: &str,
) -> Result<LocalUser, Error>;
- fn add_admin(conn: &PgConnection, person_id: PersonId, added: bool) -> Result<LocalUser, Error>;
}
impl LocalUser_ for LocalUser {
))
.get_result::<Self>(conn)
}
-
- fn add_admin(conn: &PgConnection, for_person_id: PersonId, added: bool) -> Result<Self, Error> {
- diesel::update(local_user.filter(person_id.eq(for_person_id)))
- .set(admin.eq(added))
- .get_result::<Self>(conn)
- }
}
impl Crud<LocalUserForm, LocalUserId> for LocalUser {