fix: taskModel DB 연결 및 API 응답 형식 수정

- taskModel.js: ../db/connection → ../dbPool로 수정
- dailyWorkReportController.js: getWorkTypes 응답 형식 표준화
  - res.json(data) → res.json({ success: true, data, message })

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-01-26 15:15:19 +09:00
parent 566a38562c
commit 6ff5c443be
2 changed files with 12 additions and 5 deletions

View File

@@ -478,13 +478,20 @@ const getWorkTypes = (req, res) => {
dailyWorkReportModel.getAllWorkTypes((err, data) => {
if (err) {
console.error('작업 유형 조회 오류:', err);
return res.status(500).json({
error: '작업 유형 조회 중 오류가 발생했습니다.',
details: err.message
return res.status(500).json({
success: false,
error: {
message: '작업 유형 조회 중 오류가 발생했습니다.',
code: 'DATABASE_ERROR'
}
});
}
console.log(`📋 작업 유형 조회 결과: ${data.length}`);
res.json(data);
res.json({
success: true,
data: data,
message: '작업 유형 조회 성공'
});
});
};

View File

@@ -5,7 +5,7 @@
* @since 2026-01-26
*/
const { getDb } = require('../db/connection');
const { getDb } = require('../dbPool');
// ==================== 작업 CRUD ====================