diff options
Diffstat (limited to 'app/api/projects')
| -rw-r--r-- | app/api/projects/[projectId]/stats/route.ts | 18 |
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); |
