mirror of
https://github.com/actix/examples
synced 2025-06-26 17:17:42 +02:00
bump uuid to v1
This commit is contained in:
@ -19,4 +19,4 @@ env_logger = "0.9"
|
||||
log = "0.4"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
uuid = { version = "0.8", features = ["serde", "v4"] }
|
||||
uuid = { version = "1", features = ["v4", "serde"] }
|
||||
|
@ -93,7 +93,7 @@ pub struct MutationRoot;
|
||||
impl MutationRoot {
|
||||
fn create_user(context: &Context, user: UserInput) -> FieldResult<User> {
|
||||
let mut conn = context.db_pool.get().unwrap();
|
||||
let new_id = uuid::Uuid::new_v4().to_simple().to_string();
|
||||
let new_id = uuid::Uuid::new_v4().simple().to_string();
|
||||
|
||||
let insert: Result<Option<Row>, DBError> = conn.exec_first(
|
||||
"INSERT INTO user(id, name, email) VALUES(:id, :name, :email)",
|
||||
@ -125,7 +125,7 @@ impl MutationRoot {
|
||||
|
||||
fn create_product(context: &Context, product: ProductInput) -> FieldResult<Product> {
|
||||
let mut conn = context.db_pool.get().unwrap();
|
||||
let new_id = uuid::Uuid::new_v4().to_simple().to_string();
|
||||
let new_id = uuid::Uuid::new_v4().simple().to_string();
|
||||
|
||||
let insert: Result<Option<Row>, DBError> = conn.exec_first(
|
||||
"INSERT INTO product(id, user_id, name, price) VALUES(:id, :user_id, :name, :price)",
|
||||
|
Reference in New Issue
Block a user