게시물 Export 일괄 다운로드와 재시도 추가 v1.5.24

This commit is contained in:
2026-06-01 16:02:24 +09:00
parent a4c1b42369
commit 5735fd5046
12 changed files with 321 additions and 12 deletions

View File

@@ -0,0 +1,32 @@
import { createError, getRouterParam } from 'h3'
import { requireAdminSession } from '../../../../../../utils/admin-auth'
import { retryPostExportJob } from '../../../../../../repositories/post-export-repository'
/**
* 관리자 게시물 Export 작업 재시도 API
* @param {import('h3').H3Event} event - 요청 이벤트
* @returns {Promise<Object>} 재시도 대상 Export 작업
*/
export default defineEventHandler(async (event) => {
requireAdminSession(event)
const jobId = getRouterParam(event, 'jobId')
if (!jobId) {
throw createError({
statusCode: 400,
statusMessage: 'Export 작업 ID가 필요합니다.'
})
}
const job = await retryPostExportJob(jobId)
if (!job) {
throw createError({
statusCode: 400,
statusMessage: '재시도할 수 있는 실패 작업이 아닙니다.'
})
}
return job
})