feat(tksafety): 체크리스트 작업별 항목에 tkuser 작업(task) 참조 연동

- getAllChecks: tasks/work_types/weather_conditions JOIN + 프론트엔드 필드명 alias
- createCheck/updateCheck: item_type→check_type 등 프론트-DB 필드 매핑
- 모달에 작업(task) 드롭다운 추가, 공정 선택 시 동적 로드
- renderWorktypeItems: work_type → task 2단 그룹핑
- openEditItem: async/await로 task 목록 로드 후 값 설정

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-13 21:07:29 +09:00
parent e8076a8550
commit 07aac305d6
4 changed files with 104 additions and 24 deletions

View File

@@ -23,7 +23,7 @@ exports.getCheckById = async (req, res) => {
exports.createCheck = async (req, res) => {
try {
if (!req.body.check_item) return res.status(400).json({ success: false, error: 'check_item은 필수입니다' });
if (!req.body.item_content && !req.body.check_item) return res.status(400).json({ success: false, error: '점검 항목 내용은 필수입니다' });
const checkId = await checklistModel.createCheck(req.body);
res.status(201).json({ success: true, message: '항목이 추가되었습니다', data: { check_id: checkId } });
} catch (err) {