From a89ff52cbbd18c66d838c483031bfe6e91ab7b7e Mon Sep 17 00:00:00 2001 From: redshift <213178690+1ftredsh@users.noreply.github.com> Date: Mon, 4 May 2026 20:56:36 +0530 Subject: [PATCH] fix: handle unwrapped response in npubs update command PATCH /npubs returns { npub, pubkey, role } at the top level, not wrapped in { output }. Use result.output ?? result to handle both response formats. --- src/cli.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index c2d593a..1156db8 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -985,11 +985,12 @@ npubsCmd console.log(result.error); process.exit(1); } - const output = result.output as + // PATCH /npubs returns { npub, pubkey, role } at the top level, not wrapped in { output } + const data = (result.output ?? result) as | { npub?: string; pubkey?: string; role?: string; error?: string } | undefined; - if (output?.npub) { - console.log(`Updated npub ${output.npub} role to '${output.role}'.`); + if (data?.npub) { + console.log(`Updated npub ${data.npub} role to '${data.role}'.`); } else { console.log("Npub not found or update failed."); }