Skip to content

Commit

Permalink
fix: return correct value from user/add
Browse files Browse the repository at this point in the history
  • Loading branch information
sirpy committed May 31, 2019
1 parent c01f722 commit 6f8ead9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/server/storage/storageAPI.js
Expand Up @@ -2,10 +2,10 @@
import { Router } from 'express'
import passport from 'passport'
import get from 'lodash/get'
import { type StorageAPI } from '../../imports/types'
import { type StorageAPI, UserRecord } from '../../imports/types'
import { wrapAsync } from '../utils/helpers'
import { defaults } from 'lodash'
import { UserRecord } from '../../imports/types'

import { Mautic } from '../mautic/mauticAPI'
import conf from '../server.config'
import AdminWallet from '../blockchain/AdminWallet'
Expand Down Expand Up @@ -35,10 +35,12 @@ const setup = (app: Router, storage: StorageAPI) => {
let ok = await Promise.all([
AdminWallet.topWallet(userRecord.gdAddress, null, true).catch(e => logger.error('New user topping failed', e)),
storage.updateUser({ ...user, mauticId: get(mauticRecord, 'contact.fields.all.id', -1) })
]).catch(e => {
logger.error(e)
throw e
})
])
.then(r => 1)
.catch(e => {
logger.error(e)
throw e
})
log.debug('added new user:', { user })
res.json({ ok })
})
Expand Down

0 comments on commit 6f8ead9

Please sign in to comment.