import { Prisma } from '@/generated/prisma/client';
import { handleResult } from '@/lib/http/handle-result';
import { createSport } from '@/modules/sport/services/sport.service';
import type { AppContext } from '@/types/hono';
import type { CreateSportInput } from '@repo/api-contract';

export async function createSportHandler(c: AppContext) {
  const payload = c.req.valid('json' as never) as CreateSportInput;
  return handleResult(c, await createSport(payload), 201);
}
