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:
@@ -479,12 +479,19 @@ const getWorkTypes = (req, res) => {
|
|||||||
if (err) {
|
if (err) {
|
||||||
console.error('작업 유형 조회 오류:', err);
|
console.error('작업 유형 조회 오류:', err);
|
||||||
return res.status(500).json({
|
return res.status(500).json({
|
||||||
error: '작업 유형 조회 중 오류가 발생했습니다.',
|
success: false,
|
||||||
details: err.message
|
error: {
|
||||||
|
message: '작업 유형 조회 중 오류가 발생했습니다.',
|
||||||
|
code: 'DATABASE_ERROR'
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
console.log(`📋 작업 유형 조회 결과: ${data.length}개`);
|
console.log(`📋 작업 유형 조회 결과: ${data.length}개`);
|
||||||
res.json(data);
|
res.json({
|
||||||
|
success: true,
|
||||||
|
data: data,
|
||||||
|
message: '작업 유형 조회 성공'
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @since 2026-01-26
|
* @since 2026-01-26
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const { getDb } = require('../db/connection');
|
const { getDb } = require('../dbPool');
|
||||||
|
|
||||||
// ==================== 작업 CRUD ====================
|
// ==================== 작업 CRUD ====================
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user