9d50bc8564
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
1.1 KiB
JavaScript
25 lines
1.1 KiB
JavaScript
import { ok, asyncHandler } from '../../utils/http.js';
|
|
import * as service from './service.js';
|
|
|
|
export const getStatus = asyncHandler(async (req, res) => ok(res, await service.getStatus()));
|
|
|
|
export const postProjectPlan = asyncHandler(async (req, res) => {
|
|
ok(res, await service.generateProjectPlan(Number(req.params.projectId), req.body?.description, req.body?.lang, req.currentUser));
|
|
});
|
|
|
|
export const postApplyProjectPlan = asyncHandler(async (req, res) => {
|
|
ok(res, await service.applyProjectPlan(Number(req.params.projectId), req.body?.activities, req.currentUser), 201);
|
|
});
|
|
|
|
export const postProposeProject = asyncHandler(async (req, res) => {
|
|
ok(res, await service.proposeNewProject(req.body || {}, req.currentUser));
|
|
});
|
|
|
|
export const postCreateProject = asyncHandler(async (req, res) => {
|
|
ok(res, await service.createNewProject(req.body || {}, req.currentUser), 201);
|
|
});
|
|
|
|
export const postProjectReport = asyncHandler(async (req, res) => {
|
|
ok(res, await service.generateProjectReport(Number(req.params.projectId), req.body?.lang, req.currentUser));
|
|
});
|