관리자 미디어 라이브러리 기본 기능 추가

This commit is contained in:
2026-05-01 23:42:03 +09:00
parent 83ac51fd11
commit bc531f81db
15 changed files with 553 additions and 19 deletions

View File

@@ -0,0 +1,20 @@
import { readBody } from 'h3'
import { requireAdminSession } from '../../../utils/admin-auth'
import { deleteMediaItem } from '../../../utils/media-library'
/**
* 관리자 미디어 삭제 API
* @param {import('h3').H3Event} event - 요청 이벤트
* @returns {Promise<{ ok: boolean }>} 삭제 결과
*/
export default defineEventHandler(async (event) => {
requireAdminSession(event)
const body = await readBody(event)
await deleteMediaItem(body?.url)
return {
ok: true
}
})