From 539106c4f19e6156fb092dc42dd5f2f40a8b0c83 Mon Sep 17 00:00:00 2001 From: tcheeric Date: Wed, 26 Nov 2025 13:54:18 +0000 Subject: [PATCH] fix: Convert policyId to integer in create_new_token MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The policyId parameter comes as a string from NIP-46 RPC params but Prisma expects an integer for the Token.policyId field. Added parseInt() to convert the string to integer before passing to prisma.token.create(). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/daemon/admin/commands/create_new_token.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/daemon/admin/commands/create_new_token.ts b/src/daemon/admin/commands/create_new_token.ts index d0668ee..d1d7e76 100644 --- a/src/daemon/admin/commands/create_new_token.ts +++ b/src/daemon/admin/commands/create_new_token.ts @@ -15,7 +15,7 @@ export default async function createNewToken(admin: AdminInterface, req: NDKRpcR const token = [...Array(64)].map(() => Math.floor(Math.random() * 16).toString(16)).join(''); const data: any = { - keyName, clientName, policyId, + keyName, clientName, policyId: parseInt(policyId), createdBy: req.pubkey, token };