Fix: Worker/Project status update and filtering issues

- Added cache invalidation for Workers and Projects
- Implemented server-side status filtering for Workers
- Fixed worker update query bug (removed non-existent join_date column)
- Updated daily-work-report UI to fetch only active workers
This commit is contained in:
Hyungi Ahn
2026-01-06 15:50:40 +09:00
parent 3549710325
commit 48fff7df64
6 changed files with 226 additions and 187 deletions

View File

@@ -11,6 +11,7 @@ const projectModel = require('../models/projectModel');
const { ValidationError, NotFoundError, DatabaseError } = require('../utils/errors');
const { asyncHandler } = require('../middlewares/errorHandler');
const logger = require('../utils/logger');
const cache = require('../utils/cache');
/**
* 프로젝트 생성
@@ -27,6 +28,9 @@ exports.createProject = asyncHandler(async (req, res) => {
});
});
// 프로젝트 캐시 무효화
await cache.invalidateCache.project();
logger.info('프로젝트 생성 성공', { project_id: id });
res.status(201).json({
@@ -123,6 +127,9 @@ exports.updateProject = asyncHandler(async (req, res) => {
throw new NotFoundError('프로젝트를 찾을 수 없습니다');
}
// 프로젝트 캐시 무효화
await cache.invalidateCache.project();
logger.info('프로젝트 수정 성공', { project_id: id });
res.json({
@@ -153,6 +160,9 @@ exports.removeProject = asyncHandler(async (req, res) => {
throw new NotFoundError('프로젝트를 찾을 수 없습니다');
}
// 프로젝트 캐시 무효화
await cache.invalidateCache.project();
logger.info('프로젝트 삭제 성공', { project_id: id });
res.json({