import { getPortfolio } from '../../../lib/portfolio-store'

export default defineEventHandler(async (event) => {
  const portfolio = await getPortfolio(getRouterParam(event, 'id')!)
  if (!portfolio) throw createError({ statusCode: 404, statusMessage: 'Portfolio introuvable' })
  return portfolio
})
