From 1abdb92a7119260264081094c8593edaa24903ee Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Fri, 13 Mar 2026 21:13:20 +0900 Subject: [PATCH] =?UTF-8?q?fix(tksafety):=20=EC=9E=91=EC=97=85=EB=B3=84=20?= =?UTF-8?q?=ED=95=AD=EB=AA=A9=20=ED=91=9C=EC=8B=9C=20=EC=95=88=20=EB=90=98?= =?UTF-8?q?=EB=8A=94=20=EB=B2=84=EA=B7=B8=20=E2=80=94=20check=5Ftype=20'ta?= =?UTF-8?q?sk'=20vs=20'work=5Ftype'=20=EB=B6=88=EC=9D=BC=EC=B9=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DB에 저장된 check_type='task'를 프론트에서 'work_type'으로 필터링하여 매칭 0건. HTML option value와 JS 필터를 모두 'task'로 통일. Co-Authored-By: Claude Opus 4.6 --- tksafety/web/checklist.html | 4 ++-- tksafety/web/static/js/tksafety-checklist.js | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tksafety/web/checklist.html b/tksafety/web/checklist.html index 7ab3160..8bb6783 100644 --- a/tksafety/web/checklist.html +++ b/tksafety/web/checklist.html @@ -110,7 +110,7 @@ @@ -162,7 +162,7 @@ - + diff --git a/tksafety/web/static/js/tksafety-checklist.js b/tksafety/web/static/js/tksafety-checklist.js index 456ea01..39fd87f 100644 --- a/tksafety/web/static/js/tksafety-checklist.js +++ b/tksafety/web/static/js/tksafety-checklist.js @@ -137,7 +137,7 @@ function renderWeatherItems() { /* ===== Render worktype items (2-level: work_type → task) ===== */ function renderWorktypeItems() { - const items = checklistItems.filter(i => i.item_type === 'work_type'); + const items = checklistItems.filter(i => i.item_type === 'task'); const container = document.getElementById('worktypeItemsList'); if (!items.length) { container.innerHTML = '
작업별 항목이 없습니다
'; @@ -208,7 +208,7 @@ function openAddItem(tab) { document.getElementById('itemDisplayOrder').value = '0'; // Set type based on tab - const typeMap = { basic: 'basic', weather: 'weather', worktype: 'work_type' }; + const typeMap = { basic: 'basic', weather: 'weather', worktype: 'task' }; document.getElementById('itemType').value = typeMap[tab] || 'basic'; toggleTypeFields(); @@ -251,9 +251,9 @@ function closeItemModal() { function toggleTypeFields() { const type = document.getElementById('itemType').value; document.getElementById('weatherConditionField').classList.toggle('hidden', type !== 'weather'); - document.getElementById('workTypeField').classList.toggle('hidden', type !== 'work_type'); - // Hide task field when type changes away from work_type - if (type !== 'work_type') { + document.getElementById('workTypeField').classList.toggle('hidden', type !== 'task'); + // Hide task field when type changes away from task + if (type !== 'task') { document.getElementById('taskField').classList.add('hidden'); } else { // Show task field if work type is already selected @@ -281,7 +281,7 @@ async function submitItem(e) { data.weather_condition_id = parseInt(document.getElementById('itemWeatherCondition').value) || null; if (!data.weather_condition_id) { showToast('날씨 조건을 선택해주세요', 'error'); return; } } - if (data.item_type === 'work_type') { + if (data.item_type === 'task') { const taskId = parseInt(document.getElementById('itemTask').value) || null; if (!taskId) { showToast('작업을 선택해주세요', 'error'); return; } data.task_id = taskId;