feat: redesign detail page with stage modal and milestone APIs

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
EENE Dashboard
2026-06-05 17:08:12 +09:00
parent 2307f69d19
commit 2c4ad9c4b4
9 changed files with 924 additions and 823 deletions

View File

@@ -16,15 +16,26 @@ router.post('/upload/:taskId', upload.single('file'), async (req, res, next) =>
const task = await prisma.task.findUnique({ where: { id: taskId } });
if (!task) throw new AppError(404, '업무를 찾을 수 없습니다.');
const body = req.body as Record<string, string>;
const milestoneId = body.milestoneId?.trim() || null;
if (milestoneId) {
const milestone = await prisma.milestone.findFirst({
where: { id: milestoneId, taskId },
});
if (!milestone) throw new AppError(404, '단계를 찾을 수 없습니다.');
}
const fileRecord = await prisma.file.create({
data: {
taskId,
milestoneId,
filename: req.file.filename,
originalName: req.file.originalname,
mimetype: req.file.mimetype,
size: req.file.size,
path: req.file.path,
uploadedBy: (req.body as Record<string, string>).uploadedBy ?? 'system',
uploadedBy: body.uploadedBy ?? 'system',
},
});