Skip to content

Commit

Permalink
Add conversion for compatibility and convinience
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ylide committed Apr 12, 2023
1 parent 2c5fa2c commit adcdd69
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -979,11 +979,26 @@ impl StoreMut<String> for ProjectNextStorage {
));
}
}
FieldKind::Iteration { .. } => {
FieldKind::Iteration {
iterations,
completed_iterations,
..
} => {
let new_str: String = new_value.into();
ProjectV2FieldValue {
iteration_id: Some(new_str.to_owned()),
..Default::default()
if let Some(opt) = iterations
.iter()
.chain(completed_iterations.iter())
.find(|opt| opt.title == new_str)
{
ProjectV2FieldValue {
iteration_id: Some(opt.id.to_owned()),
..Default::default()
}
} else {
return Err((
self,
GlueSQLError::Value(ValueError::ImpossibleCast),
));
}
}
}
Expand Down

0 comments on commit adcdd69

Please sign in to comment.