fix: stage save errors and add milestone progress field

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
EENE Dashboard
2026-06-05 17:10:41 +09:00
parent 2c4ad9c4b4
commit c3f620a7ac
8 changed files with 104 additions and 31 deletions

View File

@@ -2,6 +2,7 @@ import { Router } from 'express';
import path from 'path';
import fs from 'fs';
import { prisma } from '../lib/prisma';
import { resolveTaskActorId } from '../lib/resolveUser';
import { upload } from '../middleware/upload';
import { AppError } from '../middleware/errorHandler';
@@ -26,6 +27,8 @@ router.post('/upload/:taskId', upload.single('file'), async (req, res, next) =>
if (!milestone) throw new AppError(404, '단계를 찾을 수 없습니다.');
}
const uploadedBy = await resolveTaskActorId(taskId);
const fileRecord = await prisma.file.create({
data: {
taskId,
@@ -35,7 +38,7 @@ router.post('/upload/:taskId', upload.single('file'), async (req, res, next) =>
mimetype: req.file.mimetype,
size: req.file.size,
path: req.file.path,
uploadedBy: body.uploadedBy ?? 'system',
uploadedBy,
},
});