状态接口返回实际数据

This commit is contained in:
zhl 2023-04-21 10:17:42 +08:00
parent f1e8d058c2
commit 93762f058e

View File

@ -71,8 +71,14 @@ export default class ChainController extends BaseController {
@router('get /api/user/claim/:taskId')
async claimStatus(req, res) {
const { taskId } = req.params
const txHashList = []
let status = 0
return { status, txHashList }
if (!taskId) {
throw new ZError(10, 'taskId not found')
}
let record = await ClaimTask.findById(taskId)
if (!record) {
throw new ZError(12, 'task not found')
}
return { status: record.status, txHashList: record.hashList }
}
}