Updated users schema
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -46,5 +46,6 @@ diesel::table! {
|
||||
role -> Text,
|
||||
first_name -> Text,
|
||||
last_name -> Text,
|
||||
verified -> Bool,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user