import type { Context } from "hono";
import {
  updateWallet,
  updateWalletSchema,
} from "../wallets.service";

export async function updateWalletHandler(c: Context) {
  const id = Number(c.req.param("id"));
  const body = await c.req.json();
  const parsed = updateWalletSchema.parse(body);
  const result = await updateWallet(id, parsed);
  return c.json(result);
}
