diff --git a/src/controllers/chain.controller.ts b/src/controllers/chain.controller.ts index 80ff2de..0238834 100644 --- a/src/controllers/chain.controller.ts +++ b/src/controllers/chain.controller.ts @@ -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 } } }