Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): [Wallet] fix missing walletWithBalance await #48

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions apps/api/v1/routes/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ const router = new Hono()
.get('/wallets', async (c) => {
const user = getAuthUserStrict(c)

const wallets = (await findUserWallets({ user })).map(walletWithBalance)
const wallets = await Promise.all(
(await findUserWallets({ user })).map(walletWithBalance),
)

return c.json(wallets, 200)
})
Expand All @@ -37,7 +39,7 @@ const router = new Hono()

const wallet = await createWallet({ user, data })

return c.json(walletWithBalance(wallet), 201)
return c.json(await walletWithBalance(wallet), 201)
})

.put(
Expand All @@ -62,7 +64,7 @@ const router = new Hono()

const updatedWallet = await updateWallet({ walletId, data })

return c.json(walletWithBalance(updatedWallet), 200)
return c.json(await walletWithBalance(updatedWallet), 200)
},
)

Expand Down