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 helpers = require('../route-helpers')
const logger = require('../logger') const logger = require('../logger')
let LATEST_MACHINE_CONFIG_VERSION
db.connect({ direct: true }).then(sco => { db.connect({ direct: true }).then(sco => {
sco.client.on('notification', data => { sco.client.on('notification', data => {
const parsedData = JSON.parse(data.payload) const parsedData = JSON.parse(data.payload)
@ -80,7 +82,6 @@ const populateSettings = function (req, res, next) {
newSettingsLoader.load(versionId) newSettingsLoader.load(versionId)
.then(settings => { req.settings = settings }) .then(settings => { req.settings = settings })
.then(() => helpers.updateDeviceConfigVersion(versionId))
.then(() => next()) .then(() => next())
.catch(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 = { module.exports = {
stateChange, stateChange,
fetchPhoneTx, fetchPhoneTx,
fetchStatusTx, fetchStatusTx,
updateDeviceConfigVersion,
httpError httpError
} }