19 lines
499 B
TypeScript
19 lines
499 B
TypeScript
import { Hono } from 'hono';
|
|
import { problemJson, resultJson, unauthorizedProblem } from '@/http/problem-details';
|
|
import { GetGroupsRiskOverview } from './use-case';
|
|
|
|
const route = new Hono();
|
|
|
|
route.get('/overview', async (c) => {
|
|
const user = c.get('user');
|
|
if (!user) {
|
|
return problemJson(c, unauthorizedProblem(c.req.path));
|
|
}
|
|
|
|
const useCase = new GetGroupsRiskOverview();
|
|
const result = await useCase.execute(user.id);
|
|
|
|
return resultJson(c, result);
|
|
});
|
|
|
|
export default route; |