fix: Convert policyId to integer in create_new_token

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 <noreply@anthropic.com>
This commit is contained in:
tcheeric 2025-11-26 13:54:18 +00:00
parent a23c6bc932
commit 539106c4f1

View File

@ -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
};