Updated users schema

This commit is contained in:
Benjamin Sherriff
2023-10-18 23:10:54 -04:00
parent 0bda10c23b
commit 55b8b1a0e3
5 changed files with 81 additions and 36 deletions

View File

@@ -27,6 +27,7 @@ impl RegisterUser {
role: "user".to_string(),
first_name: self.first_name,
last_name: self.last_name,
verified: false,
})
}
}
@@ -45,6 +46,7 @@ pub struct QueryUser {
pub role: String,
pub first_name: String,
pub last_name: String,
pub verified: bool,
}
impl QueryUser {
@@ -67,6 +69,7 @@ pub struct InsertUser {
pub role: String,
pub first_name: String,
pub last_name: String,
pub verified: bool,
}
impl InsertUser {

View File

@@ -350,6 +350,7 @@ pub fn init_routes(config: &mut web::ServiceConfig) {
};
let mut u = r.convert_to_insert().unwrap();
u.role = "admin".to_string();
u.verified = true;
let _ = InsertUser::insert(u);
config.service(web::scope("auth")
.service(register)