fix(clearance): 修正强制推送接口类型推断

This commit is contained in:
居居 2026-11-27 18:09:52 +08:00
parent 056317fcd6
commit d459fb343a

View File

@ -63,16 +63,21 @@ export async function POST(request: NextRequest) {
if (!parsed.success) {
return jsonError(ErrorCode.VALIDATION_INVALID_FORMAT, '批量审核参数不正确', 400, ctx.requestId)
}
let result
if (parsed.data.action === 'force-push') {
return jsonSuccess(await supplyChainClearanceService.forcePushReviewTasks({
result = await supplyChainClearanceService.forcePushReviewTasks({
ids: parsed.data.items.map((item) => item.id),
note: parsed.data.note,
user: ctx.user,
}), 200, ctx.requestId)
})
} else {
const action: 'approve' | 'reject' = parsed.data.action
result = await supplyChainClearanceService.batchReviewTasks({
...parsed.data,
action,
user: ctx.user,
})
}
return jsonSuccess(await supplyChainClearanceService.batchReviewTasks({
...parsed.data,
user: ctx.user,
}), 200, ctx.requestId)
return jsonSuccess(result, 200, ctx.requestId)
}, { requireAuth: true })
}