From d19b925db00c929ee86eecd354c3138435c6ec65 Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Wed, 29 Jan 2025 20:44:34 -0300 Subject: [PATCH] fix: get first event from query --- src/controllers/api/ditto.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/api/ditto.ts b/src/controllers/api/ditto.ts index 5ee07b60..63f0561a 100644 --- a/src/controllers/api/ditto.ts +++ b/src/controllers/api/ditto.ts @@ -364,7 +364,7 @@ export const createCashuWalletController: AppController = async (c) => { return c.json({ error: 'Bad request', schema: result.error }, 400); } - const event = await store.query([{ authors: [pubkey], kinds: [37375] }], { signal }); + const [event] = await store.query([{ authors: [pubkey], kinds: [37375] }], { signal }); if (event) { return c.json({ error: 'You already have a wallet 😏', schema: result.error }, 400); }