summaryrefslogtreecommitdiff
path: root/app/api
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-11-07 03:00:58 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-11-07 03:00:58 +0000
commit4b6ebdef8281a413fa2bfbdf8f5565eb8b106c62 (patch)
tree0c4f0249af06ead92046931bfce26624a938311c /app/api
parentcc2dc9c162ceadfc41f8fa1fcd4c82341c33af7c (diff)
(임수민) 데이터룸 최근활동 캐시 수정
Diffstat (limited to 'app/api')
-rw-r--r--app/api/projects/[projectId]/stats/route.ts18
1 files changed, 14 insertions, 4 deletions
diff --git a/app/api/projects/[projectId]/stats/route.ts b/app/api/projects/[projectId]/stats/route.ts
index dc2397ac..d3d42a17 100644
--- a/app/api/projects/[projectId]/stats/route.ts
+++ b/app/api/projects/[projectId]/stats/route.ts
@@ -201,9 +201,13 @@ export async function GET(
};
roleStats.forEach(stat => {
- if (stat.role === 'manager') byRole.admin = Number(stat.count);
- else if (stat.role === 'member') byRole.editor = Number(stat.count);
- else byRole.viewer = Number(stat.count);
+ if (stat.role === 'owner' || stat.role === 'admin') {
+ byRole.admin = Number(stat.count);
+ } else if (stat.role === 'editor') {
+ byRole.editor = Number(stat.count);
+ } else {
+ byRole.viewer = Number(stat.count);
+ }
});
// 4. 최근 활동 내역
@@ -263,7 +267,13 @@ export async function GET(
recent,
};
- return NextResponse.json(stats);
+ return NextResponse.json(stats, {
+ headers: {
+ 'Cache-Control': 'no-store, no-cache, must-revalidate, proxy-revalidate',
+ 'Pragma': 'no-cache',
+ 'Expires': '0',
+ },
+ });
} catch (error) {
console.error('통계 조회 오류:', error);