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,14 +1,12 @@
import { query } from '../../utils/db'
import { requireAuth } from '../../utils/session'
/**
* 내가 보고서 작성한 프로젝트 목록
* GET /api/project/my-projects
*/
export default defineEventHandler(async (event) => {
const userId = getCookie(event, 'user_id')
if (!userId) {
throw createError({ statusCode: 401, message: '로그인이 필요합니다.' })
}
const userId = await requireAuth(event)
// 내가 주간보고를 작성한 프로젝트 + 전체 활성 프로젝트
const projects = await query(`
@@ -23,7 +21,7 @@ export default defineEventHandler(async (event) => {
) t ON p.project_id = t.project_id
WHERE p.project_status = 'ACTIVE'
ORDER BY has_my_report DESC, p.project_name
`, [parseInt(userId)])
`, [userId])
return projects.map((p: any) => ({
projectId: p.project_id,