mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-19 14:31:05 +00:00
refactor: parent cloning
This commit is contained in:
parent
b63f1f4bfa
commit
b74211aa96
2 changed files with 3 additions and 3 deletions
|
|
@ -88,7 +88,7 @@ mod tests {
|
|||
.await
|
||||
.unwrap();
|
||||
|
||||
Mutation::add_parent_details(&db, parent.clone(), encrypted_details.parents[0].clone())
|
||||
let parent = Mutation::add_parent_details(&db, parent, encrypted_details.parents[0].clone())
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
|
|
|
|||
|
|
@ -30,11 +30,11 @@ impl ParentService {
|
|||
let mut result = vec![];
|
||||
for i in 0..parents_details.len() {
|
||||
let found_parent = match found_parents.get(i) {
|
||||
Some(parent) => parent.clone(),
|
||||
Some(parent) => parent.to_owned(),
|
||||
None => ParentService::create(db, ref_candidate.application).await?,
|
||||
};
|
||||
let enc_details = EncryptedParentDetails::new(&parents_details[i], recipients).await?;
|
||||
let parent = Mutation::add_parent_details(db, found_parent.clone(), enc_details.clone()).await?;
|
||||
let parent = Mutation::add_parent_details(db, found_parent, enc_details.clone()).await?;
|
||||
result.push(parent);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue