summaryrefslogtreecommitdiff
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
parentcc2dc9c162ceadfc41f8fa1fcd4c82341c33af7c (diff)
(임수민) 데이터룸 최근활동 캐시 수정
-rw-r--r--app/[lng]/evcp/data-room/[projectId]/stats/page.tsx8
-rw-r--r--app/[lng]/partners/data-room/[projectId]/stats/page.tsx8
-rw-r--r--app/api/projects/[projectId]/stats/route.ts18
3 files changed, 28 insertions, 6 deletions
diff --git a/app/[lng]/evcp/data-room/[projectId]/stats/page.tsx b/app/[lng]/evcp/data-room/[projectId]/stats/page.tsx
index 7f652a99..4cfa3ad0 100644
--- a/app/[lng]/evcp/data-room/[projectId]/stats/page.tsx
+++ b/app/[lng]/evcp/data-room/[projectId]/stats/page.tsx
@@ -82,7 +82,13 @@ export default function ProjectStatsPage({
try {
setLoading(true);
const response = await fetch(
- `/api/projects/${projectId}/stats?range=${dateRange}`
+ `/api/projects/${projectId}/stats?range=${dateRange}`,
+ {
+ cache: 'no-store',
+ headers: {
+ 'Cache-Control': 'no-cache',
+ },
+ }
);
if (!response.ok) {
diff --git a/app/[lng]/partners/data-room/[projectId]/stats/page.tsx b/app/[lng]/partners/data-room/[projectId]/stats/page.tsx
index 7f652a99..4cfa3ad0 100644
--- a/app/[lng]/partners/data-room/[projectId]/stats/page.tsx
+++ b/app/[lng]/partners/data-room/[projectId]/stats/page.tsx
@@ -82,7 +82,13 @@ export default function ProjectStatsPage({
try {
setLoading(true);
const response = await fetch(
- `/api/projects/${projectId}/stats?range=${dateRange}`
+ `/api/projects/${projectId}/stats?range=${dateRange}`,
+ {
+ cache: 'no-store',
+ headers: {
+ 'Cache-Control': 'no-cache',
+ },
+ }
);
if (!response.ok) {
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);