export default defineEventHandler((event) => {
  const config = useRuntimeConfig();
  const id = getRouterParam(event, 'id');

  if (!id) {
    throw createError({
      statusCode: 400,
      message: 'Good ID is required',
    });
  }

  return $fetch(`${config.public.backendUrl}/public/goods/${id}`);
});
