getCookie 제거
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
import { query } from '../../utils/db'
|
||||
import { requireAuth } from '../../utils/session'
|
||||
|
||||
/**
|
||||
* 개선의견 목록 조회
|
||||
* GET /api/feedback/list
|
||||
*/
|
||||
export default defineEventHandler(async (event) => {
|
||||
const userId = getCookie(event, 'user_id')
|
||||
if (!userId) {
|
||||
throw createError({ statusCode: 401, message: '로그인이 필요합니다.' })
|
||||
}
|
||||
const userId = await requireAuth(event)
|
||||
|
||||
const q = getQuery(event)
|
||||
const page = parseInt(q.page as string) || 1
|
||||
@@ -91,7 +89,7 @@ export default defineEventHandler(async (event) => {
|
||||
createdAt: f.created_at,
|
||||
updatedAt: f.updated_at,
|
||||
isLiked: f.is_liked,
|
||||
isOwner: f.author_id === parseInt(userId)
|
||||
isOwner: f.author_id === userId
|
||||
})),
|
||||
pagination: {
|
||||
page,
|
||||
|
||||
Reference in New Issue
Block a user