Initial commit

This commit is contained in:
Jose Selesan
2026-04-08 22:53:11 -03:00
commit 9ae270609d
179 changed files with 28096 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import type { CreateSportInput } from '@repo/api-contract'
import { Prisma } from '@/generated/prisma/client'
import type { AppContext } from '@/types/hono'
import { createSport } from '@/modules/sport/services/sport.service'
export async function createSportHandler(c: AppContext) {
const payload = c.req.valid('json' as never) as CreateSportInput
try {
const sport = await createSport(payload)
return c.json(sport, 201)
} catch (error) {
if (error instanceof Prisma.PrismaClientKnownRequestError) {
return c.json({ message: 'No se pudo crear el deporte.' }, 409)
}
throw error
}
}