fix: remove unnecessary query

This commit is contained in:
Sérgio Salgado 2022-09-28 17:18:12 +01:00
parent d62db527de
commit fbf8933680
2 changed files with 2 additions and 6 deletions

View file

@ -6,6 +6,8 @@ const newSettingsLoader = require('../new-settings-loader')
const helpers = require('../route-helpers')
const logger = require('../logger')
let LATEST_MACHINE_CONFIG_VERSION
db.connect({ direct: true }).then(sco => {
sco.client.on('notification', data => {
const parsedData = JSON.parse(data.payload)
@ -80,7 +82,6 @@ const populateSettings = function (req, res, next) {
newSettingsLoader.load(versionId)
.then(settings => { req.settings = settings })
.then(() => helpers.updateDeviceConfigVersion(versionId))
.then(() => next())
.catch(next)
}

View file

@ -85,14 +85,9 @@ function fetchStatusTx (txId, status) {
})
}
function updateDeviceConfigVersion (versionId) {
return db.none('update devices set user_config_id=$1', [versionId])
}
module.exports = {
stateChange,
fetchPhoneTx,
fetchStatusTx,
updateDeviceConfigVersion,
httpError
}