diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-07-07 08:24:16 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-07-07 08:24:16 +0000 |
| commit | 44bdb81a60d3a44ba7e379f3c20fe6d8fb284339 (patch) | |
| tree | b5c916a1c7ea37573f9bba7fefcef60a3b8aec20 /lib/evaluation | |
| parent | 90f79a7a691943a496f67f01c1e493256070e4de (diff) | |
(대표님) 변경사항 20250707 12시 30분
Diffstat (limited to 'lib/evaluation')
| -rw-r--r-- | lib/evaluation/service.ts | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/evaluation/service.ts b/lib/evaluation/service.ts index 67a692ab..bbe9daa9 100644 --- a/lib/evaluation/service.ts +++ b/lib/evaluation/service.ts @@ -28,7 +28,8 @@ import { GetEvaluationTargetsSchema } from "../evaluation-target-list/validation import { sendEmail } from "../mail/sendEmail" import { revalidatePath } from "next/cache" import { DEPARTMENT_CODE_LABELS } from "@/types/evaluation" - +import { getServerSession } from "next-auth" +import { authOptions } from "@/app/api/auth/[...nextauth]/route" export async function getPeriodicEvaluations(input: GetEvaluationTargetsSchema) { try { @@ -756,8 +757,8 @@ export async function finalizeEvaluations( ) { try { // 현재 사용자 정보 가져오기 - const currentUser = await getCurrentUser() - if (!currentUser) { + const session = await getServerSession(authOptions) + if (!session?.user) { throw new Error("인증이 필요합니다") } @@ -795,7 +796,7 @@ export async function finalizeEvaluations( finalGrade: evaluation.finalGrade, status: "FINALIZED", finalizedAt: now, - finalizedBy: currentUser.id, + finalizedBy: session?.user?.id ? Number(session.user.id) : null, updatedAt: now, }) .where(eq(periodicEvaluations.id, evaluation.id)) @@ -824,8 +825,8 @@ export async function finalizeEvaluations( */ export async function unfinalizeEvaluations(evaluationIds: number[]) { try { - const currentUser = await getCurrentUser() - if (!currentUser) { + const session = await getServerSession(authOptions) + if (!session?.user) { throw new Error("인증이 필요합니다") } |
