mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-29 05:50:31 +08:00
httpd: Allow edit revision embeds
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use super::*;
|
||||
|
||||
use radicle::cob::patch;
|
||||
use radicle::cob::{patch, resolve_embed};
|
||||
use radicle::prelude::*;
|
||||
use radicle::storage::git::Repository;
|
||||
|
||||
@@ -38,13 +38,18 @@ pub fn run(
|
||||
|
||||
let (root, _) = patch.root();
|
||||
let target = patch.target();
|
||||
let embeds = patch
|
||||
.embeds()
|
||||
.into_iter()
|
||||
.filter_map(|embed| resolve_embed(repository, embed.clone()))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
patch.transaction("Edit", &signer, |tx| {
|
||||
if let Some(t) = title {
|
||||
tx.edit(t, target)?;
|
||||
}
|
||||
if let Some(d) = description {
|
||||
tx.edit_revision(root, d, Vec::default())?;
|
||||
tx.edit_revision(root, d, embeds)?;
|
||||
}
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
Reference in New Issue
Block a user