fix: sync production DB schema for task detail API
Always run prisma db push on Render build and start so milestones/files columns exist for GET /tasks/:id.
This commit is contained in:
@@ -22,5 +22,12 @@ export function errorHandler(
|
||||
}
|
||||
|
||||
console.error('[Error]', err);
|
||||
|
||||
const prismaCode = (err as { code?: string }).code;
|
||||
if (prismaCode === 'P2022') {
|
||||
res.status(500).json({ message: 'DB 스키마가 최신이 아닙니다. 배포 후 다시 시도해 주세요.' });
|
||||
return;
|
||||
}
|
||||
|
||||
res.status(500).json({ message: '서버 오류가 발생했습니다.' });
|
||||
}
|
||||
|
||||
@@ -34,8 +34,9 @@ router.get('/', async (req, res, next) => {
|
||||
// GET /api/tasks/:id — 단건 상세 조회
|
||||
router.get('/:id', async (req, res, next) => {
|
||||
try {
|
||||
const taskId = String(req.params.id);
|
||||
const task = await prisma.task.findUnique({
|
||||
where: { id: req.params.id },
|
||||
where: { id: taskId },
|
||||
include: {
|
||||
assignee: { select: { id: true, name: true, department: true } },
|
||||
creator: { select: { id: true, name: true } },
|
||||
|
||||
Reference in New Issue
Block a user