fix(tkpurchase): 일정 목록 미표시 버그 수정 — 캐시·타임존·페이지네이션
- API에 Cache-Control: no-store 미들웨어 추가 (304 캐시 문제 해결) - toLocalDate() 유틸 추가, 전체 8개 JS의 toISOString 타임존 버그 수정 - scheduleModel.findAll에 total COUNT 추가, 컨트롤러에서 total 반환 - HTML 캐시 버스팅 ?v=2026031601 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@ const scheduleModel = require('../models/scheduleModel');
|
||||
async function list(req, res) {
|
||||
try {
|
||||
const { company, company_id, date_from, date_to, status, project_id, page, limit } = req.query;
|
||||
const rows = await scheduleModel.findAll({
|
||||
const { rows, total } = await scheduleModel.findAll({
|
||||
company: company || undefined,
|
||||
company_id: company_id ? parseInt(company_id) : undefined,
|
||||
date_from,
|
||||
@@ -14,7 +14,7 @@ async function list(req, res) {
|
||||
page: page ? parseInt(page) : 1,
|
||||
limit: limit ? parseInt(limit) : 50
|
||||
});
|
||||
res.json({ success: true, data: rows });
|
||||
res.json({ success: true, data: rows, total });
|
||||
} catch (err) {
|
||||
console.error('Schedule list error:', err);
|
||||
res.status(500).json({ success: false, error: err.message });
|
||||
|
||||
Reference in New Issue
Block a user