export const evaluationRoundRouter = new Hono()
.use('/*', isLoggedIn)
.get('/', zValidator('query', selectListEvaluationRoundParamsSchema, validationErrorHook), async c => {
const path = c.req.path;
const params = c.req.valid('query');
const result = await evaluationRoundService.selectList(params);
const response = ResponseCreator.success(
ResponseCreator.list(
result.rows,
result.count,
params.offset && Math.floor(params.offset / (params.limit || 10)) + 1,
params.limit
),
ResponseType.LIST,
{ query: params }
);
return c.json(response);
})
.get('/id/:id',
zValidator('param', selectInfoEvaluationRoundParamsSchema, validationErrorHook),
async c => {
const path = c.req.path;
const params = c.req.valid('param');
const result = await evaluationRoundService.selectInfoById(params);
const response = ResponseCreator.success(
result,
ResponseType.INFO,
{ param: params }
);
return c.json(response);
}
);
const app = new Hono().route('/evaluation/evaluation-round', evaluationRoundRouter);
export const evaluationRoundRouter = new Hono()
.use('/*', isLoggedIn)
.get('/', zValidator('query', selectListEvaluationRoundParamsSchema, validationErrorHook), async c => {
const path = c.req.path;
const params = c.req.valid('query');
const result = await evaluationRoundService.selectList(params);
const response = ResponseCreator.success(
ResponseCreator.list(
result.rows,
result.count,
params.offset && Math.floor(params.offset / (params.limit || 10)) + 1,
params.limit
),
ResponseType.LIST,
{ query: params }
);
return c.json(response);
})
.get('/id/:id',
zValidator('param', selectInfoEvaluationRoundParamsSchema, validationErrorHook),
async c => {
const path = c.req.path;
const params = c.req.valid('param');
const result = await evaluationRoundService.selectInfoById(params);
const response = ResponseCreator.success(
result,
ResponseType.INFO,
{ param: params }
);
return c.json(response);
}
);
const app = new Hono().route('/evaluation/evaluation-round', evaluationRoundRouter);