From 4de5dbdc3c7416e0097b2892709e5a2c19447ad3 Mon Sep 17 00:00:00 2001 From: Sebastian Pravda Date: Sat, 14 Jan 2023 11:09:51 +0100 Subject: [PATCH] fix: update school_name, health_insurence in update_candidate_details method --- core/src/database/mutation/candidate.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/database/mutation/candidate.rs b/core/src/database/mutation/candidate.rs index d5d853e..cd4793a 100644 --- a/core/src/database/mutation/candidate.rs +++ b/core/src/database/mutation/candidate.rs @@ -67,6 +67,7 @@ impl Mutation { ) -> Result { let application = user.application; let mut user: candidate::ActiveModel = user.into(); + user.name = Set(enc_candidate.name.map(|e| e.into())); user.surname = Set(enc_candidate.surname.map(|e| e.into())); user.birthplace = Set(enc_candidate.birthplace.map(|e| e.into())); @@ -77,6 +78,8 @@ impl Mutation { user.email = Set(enc_candidate.email.map(|e| e.into())); user.sex = Set(enc_candidate.sex.map(|e| e.into())); user.personal_identification_number = Set(enc_candidate.personal_id_number.map(|e| e.into()).unwrap_or_default()); // TODO: do not set this here, it is already set in the create_candidate mutation??? + user.school_name = Set(enc_candidate.school_name.map(|e| e.into())); + user.health_insurance = Set(enc_candidate.health_insurance.map(|e| e.into())); user.study = Set(enc_candidate.study.map(|e| e.into())); user.updated_at = Set(chrono::offset::Local::now().naive_local());