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,15 +1,13 @@
import { query } from '../../../utils/db'
import { getWeekInfo, formatWeekString } from '../../../utils/week-calc'
import { requireAuth } from '../../../utils/session'
/**
* 이번 주 보고서 현황 조회
* GET /api/report/weekly/current-week
*/
export default defineEventHandler(async (event) => {
const userId = getCookie(event, 'user_id')
if (!userId) {
throw createError({ statusCode: 401, message: '로그인이 필요합니다.' })
}
const userId = await requireAuth(event)
const weekInfo = getWeekInfo()
@@ -20,7 +18,7 @@ export default defineEventHandler(async (event) => {
JOIN wr_project_info p ON r.project_id = p.project_id
WHERE r.author_id = $1 AND r.report_year = $2 AND r.report_week = $3
ORDER BY p.project_name
`, [parseInt(userId), weekInfo.year, weekInfo.week])
`, [userId, weekInfo.year, weekInfo.week])
return {
weekInfo: {