Skip to content

Commit

Permalink
fix(api): [Wallet] fix missing walletWithBalance await (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
duongdev committed Jun 8, 2024
1 parent ac88b27 commit eb3321c
Showing 1 changed file with 5 additions and 3 deletions.
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

0 comments on commit eb3321c

Please sign in to comment.