Keep the original plan preview when adding display metadata
This commit is contained in:
@@ -1220,7 +1220,10 @@ async fn plan_get_http(
|
||||
let approval = metadata["approval_state"].as_str().map(str::to_owned);
|
||||
let mut view = plan_view(&plan, &hash, approval, &bytes)?;
|
||||
for (key, value) in metadata.as_object().into_iter().flatten() {
|
||||
view[key] = value.clone();
|
||||
// The preview's deadline retains the precision of the immutable plan bytes.
|
||||
if view.get(key).is_none() {
|
||||
view[key] = value.clone();
|
||||
}
|
||||
}
|
||||
tx.commit().await?;
|
||||
Ok(Json(view))
|
||||
|
||||
Reference in New Issue
Block a user