미디어 카테고리 관리 추가
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { readBody } from 'h3'
|
||||
import { requireAdminSession } from '../../../utils/admin-auth'
|
||||
import { renameMediaItem } from '../../../utils/media-library'
|
||||
import { renameMediaItem, updateMediaCategory } from '../../../utils/media-library'
|
||||
|
||||
/**
|
||||
* 관리자 미디어 파일명 변경 API
|
||||
@@ -12,5 +12,9 @@ export default defineEventHandler(async (event) => {
|
||||
|
||||
const body = await readBody(event)
|
||||
|
||||
if (body?.category !== undefined) {
|
||||
return updateMediaCategory(body?.url, body?.category)
|
||||
}
|
||||
|
||||
return renameMediaItem(body?.url, body?.name || '')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user