From 0cb188bb8c062b7d346ac7cb398ab59827e4c438 Mon Sep 17 00:00:00 2001 From: chaosBreaking Date: Sun, 29 Sep 2019 13:09:35 +0800 Subject: [PATCH] fix: hotfix --- src/modules/action/action.handler.js | 2 +- src/modules/fund/fund.model.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/action/action.handler.js b/src/modules/action/action.handler.js index 1ca2d30..5188f59 100644 --- a/src/modules/action/action.handler.js +++ b/src/modules/action/action.handler.js @@ -18,7 +18,7 @@ function createAction (actCode, data) { function createDepositAction(data = {}) { const { userId, amount, tokenType, remain } = data; - if (!userId || !amount || !tokenType) return false; + if (!userId || !tokenType) return false; return new Action({ userId, type: 0, diff --git a/src/modules/fund/fund.model.js b/src/modules/fund/fund.model.js index db8d093..9755b4a 100644 --- a/src/modules/fund/fund.model.js +++ b/src/modules/fund/fund.model.js @@ -107,7 +107,7 @@ FundModel.prototype.addFund = async (txlist = [], option) => { tokenType: 'vic', // 目前设定只能挖出矿晶vic remain: this.asset }); - actionPromiseList.push(action.save()); + typeof action.save === 'function' && actionPromiseList.push(action.save()); txObj.amount = depositAmount; // 之后返回fundList里的数值需要把区块链的数值乘以比率 !!!! return createNewFund(txObj); });