fix registry rm command (#2955)

This commit is contained in:
Dominion5254
2025-05-27 19:00:29 -06:00
committed by GitHub
parent 29c9419a6e
commit 05b8dd9ad8
2 changed files with 5 additions and 1 deletions

View File

@@ -167,8 +167,9 @@ pub struct RemovePackageParams {
pub id: PackageId,
pub version: VersionString,
#[ts(skip)]
#[arg(skip)]
#[serde(rename = "__auth_signer")]
pub signer: AnyVerifyingKey,
pub signer: Option<AnyVerifyingKey>,
}
pub async fn remove_package(
@@ -180,6 +181,8 @@ pub async fn remove_package(
}: RemovePackageParams,
) -> Result<(), Error> {
let peek = ctx.db.peek().await;
let signer =
signer.ok_or_else(|| Error::new(eyre!("missing signer"), ErrorKind::InvalidRequest))?;
let signer_guid = peek.as_index().as_signers().get_signer(&signer)?;
ctx.db

View File

@@ -34,6 +34,7 @@ pub fn package_api<C: Context>() -> ParentHandler<C> {
.subcommand(
"remove",
from_fn_async(add::remove_package)
.with_metadata("get_signer", Value::Bool(true))
.no_display()
.with_about("Remove package from registry index")
.with_call_remote::<CliContext>(),