refactor: remove unnecessary operations
This commit is contained in:
parent
050fb6589d
commit
bc78837d39
2 changed files with 8 additions and 167 deletions
|
|
@ -15,7 +15,6 @@ const httpError = require('../route-helpers').httpError
|
|||
const notifier = require('../notifier')
|
||||
const respond = require('../respond')
|
||||
const { getTx } = require('../new-admin/services/transactions.js')
|
||||
const { getCustomerById } = require('../customers')
|
||||
const machineLoader = require('../machine-loader')
|
||||
const { loadLatestConfig } = require('../new-settings-loader')
|
||||
const customInfoRequestQueries = require('../new-admin/services/customInfoRequests')
|
||||
|
|
@ -142,7 +141,7 @@ function updateTxCustomerPhoto (req, res, next) {
|
|||
function buildSms (data, receiptOptions) {
|
||||
return Promise.all([getTx(data.session, data.txClass), loadLatestConfig()])
|
||||
.then(([tx, config]) => {
|
||||
return Promise.all([getCustomerById(tx.customer_id), machineLoader.getMachine(tx.device_id, config)])
|
||||
return Promise.all([customers.getCustomerById(tx.customer_id), machineLoader.getMachine(tx.device_id, config)])
|
||||
.then(([customer, deviceConfig]) => {
|
||||
const formattedTx = _.mapKeys(_.camelCase)(tx)
|
||||
const localeConfig = configManager.getLocale(formattedTx.deviceId, config)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue