refactor: SELECT only the name column

This commit is contained in:
siiky 2024-07-18 17:22:47 +01:00
parent 7638e277ca
commit eae24505f7

View file

@ -148,7 +148,7 @@ function getMachineNames (config) {
* @returns {string} machine name * @returns {string} machine name
*/ */
function getMachineName (machineId) { function getMachineName (machineId) {
const sql = 'SELECT * FROM devices WHERE device_id=$1' const sql = 'SELECT name FROM devices WHERE device_id=$1'
return db.oneOrNone(sql, [machineId]) return db.oneOrNone(sql, [machineId])
.then(it => it.name) .then(it => it.name)
} }