Files
O96u f17d79b236
ci / ci (22, ubuntu-latest) (push) Canceled after 0s
GitHub Release / release (push) Canceled after 0s
Publish Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Canceled after 0s
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Canceled after 0s
Publish Docker image / merge (push) Canceled after 0s
release: v1.3.0 — 整站备份恢复、跨后端同步与任务中心
2026-09-07 17:05:12 +08:00

18 lines
550 B
TypeScript

import { createApiError } from '../../../utils/api-error'
import { serializeBackupJob } from '../../../utils/backup/api'
import { getBackupJob } from '../../../utils/backup/jobs'
export default defineEventHandler((event) => {
const id = getRouterParam(event, 'id')
if (!id) {
createApiError(event, 'INVALID_REQUEST', '缺少任务 ID', 400)
}
const job = getBackupJob(id)
if (!job || job.type !== 'full_restore') {
createApiError(event, 'INVALID_REQUEST', '任务不存在', 404)
}
return { job: serializeBackupJob(job) }
})