feat(simulations): GET /simulations/:id — lecture rapport avec auth + REPORT_NOT_READY

This commit is contained in:
Hermann_Kitio 2026-04-20 04:41:24 +03:00
parent 6ca2412304
commit 0680a6382f
3 changed files with 215 additions and 0 deletions

View file

@ -78,4 +78,18 @@ simulations.post('/', authMiddleware, async (c) => {
return c.json(result.data, 201)
})
simulations.get('/:id', authMiddleware, async (c) => {
// `:id` est garanti présent par le pattern de route Hono
const id = c.req.param('id')!
const profile = c.get('profile')
const result = await simulationController.getById(id, profile)
if ('error' in result) {
return c.json(result, result.status as 401 | 404 | 500)
}
return c.json(result.data, 200)
})
export default simulations