getCookie 제거

This commit is contained in:
2026-01-10 21:59:11 +09:00
parent ef7914d5c6
commit 1b8cd8577e
30 changed files with 195 additions and 145 deletions

View File

@@ -1,12 +1,19 @@
import { queryOne, query } from '../../../utils/db'
import { requireAuth, getSessionIdFromCookie, getDbSession } from '../../../utils/session'
/**
* 직원 상세 조회
* GET /api/employee/[id]/detail
*/
export default defineEventHandler(async (event) => {
await requireAuth(event)
const employeeId = getRouterParam(event, 'id')
const currentHistoryId = getCookie(event, 'login_history_id')
// 세션에서 현재 로그인 히스토리 ID 가져오기
const sessionId = getSessionIdFromCookie(event)
const session = sessionId ? await getDbSession(sessionId) : null
const currentHistoryId = session?.loginHistoryId || null
const employee = await queryOne<any>(`
SELECT * FROM wr_employee_info WHERE employee_id = $1