From 00e050986ee0d7eaea2a510687bf57d5022e8a13 Mon Sep 17 00:00:00 2001 From: Sebastian Pravda Date: Mon, 24 Oct 2022 19:15:16 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20unable=20to=20insert=20kv=C5=AFli=20prim?= =?UTF-8?q?ary=20key=20-=20using=20insert=20instead=20of=20save?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/mutation.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/mutation.rs b/core/src/mutation.rs index 16ec10a..30d7c04 100644 --- a/core/src/mutation.rs +++ b/core/src/mutation.rs @@ -9,10 +9,10 @@ impl Mutation { db: &DbConn, form_data: candidate::Model, plain_text_password: &String, - ) -> Result { + ) -> Result { let hashed_password = hash_password(plain_text_password); candidate::ActiveModel { - application: Set(145 as i32), // TODO NEFUNGUJE + application: Set(form_data.application), // TODO NEFUNGUJE code: Set(hashed_password), public_key: Set("lorem ipsum pub key".to_string()), private_key: Set("lorem ipsum priv key".to_string()), @@ -20,7 +20,7 @@ impl Mutation { updated_at: Set(chrono::offset::Local::now().naive_local()), ..Default::default() } - .save(db) + .insert(db) .await } }