1
0
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:
Rob Ede
2022-07-31 23:51:08 +01:00
parent 9adb5d3f0e
commit 0149e64c7a
3 changed files with 5 additions and 4 deletions

View File

@ -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"] }

View File

@ -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)",