fix: get first event from query

This commit is contained in:
P. Reis 2025-01-29 20:44:34 -03:00
parent d5ff66a542
commit d19b925db0

View file

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