Initial commit
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import type { AppContext } from '@/types/hono'
|
||||
import { getComplexById } from '@/modules/complex/services/complex.service'
|
||||
|
||||
type ComplexIdParams = { id: string }
|
||||
|
||||
export async function getComplexByIdHandler(c: AppContext) {
|
||||
const { id } = c.req.valid('param' as never) as ComplexIdParams
|
||||
|
||||
const complex = await getComplexById(id)
|
||||
|
||||
if (!complex) {
|
||||
return c.json({ message: 'Complejo no encontrado.' }, 404)
|
||||
}
|
||||
|
||||
return c.json(complex)
|
||||
}
|
||||
Reference in New Issue
Block a user