aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2019-01-02 17:41:34 +0000
committerAdam Soltys <[email protected]>2019-02-05 20:53:45 -0800
commite394980f82c40883e42e01d63f54ea33c702f091 (patch)
treeb2e2b93eb6830db129a71518f109554aa1167e72
parent251587a49bd7e6d321e7cf351d1e12e001f2886c (diff)
downloadcoinos-server-e394980f82c40883e42e01d63f54ea33c702f091.tar.gz
coinos-server-e394980f82c40883e42e01d63f54ea33c702f091.zip
check pending value is not zero
-rw-r--r--index.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/index.js b/index.js
index c0a6beb7..e23e29fc 100644
--- a/index.js
+++ b/index.js
@@ -218,8 +218,17 @@ const l = console.log
await db.User.findAll({
attributes: ['id', 'pending'],
- where: { pending: { [Sequelize.Op.ne]: null } },
- }).map(async u => { u.balance = u.pending; u.pending = 0; await u.save() })
+ where: {
+ pending: {
+ [Sequelize.Op.ne]: null,
+ [Sequelize.Op.ne]: 0,
+ }
+ },
+ }).map(async u => {
+ u.balance = u.pending
+ u.pending = 0
+ await u.save()
+ })
await db.Payment.update({
confirmed: true,
@@ -498,7 +507,6 @@ const l = console.log
let ask = res.data.asks[0][0]
let now = new Date()
let ts = `${now.getHours()}:${now.getMinutes()}:${now.getSeconds()}`
- l(sids)
l(ts, 'quadriga ask price:', ask)
app.set('rates', { ask })
socket.emit('rate', ask)