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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user