fix: parameterize query
This commit is contained in:
parent
2aea5a523c
commit
be06ea5097
1 changed files with 2 additions and 2 deletions
|
|
@ -2,8 +2,8 @@ const db = require('./db')
|
||||||
const _ = require('lodash/fp')
|
const _ = require('lodash/fp')
|
||||||
|
|
||||||
function getOperatorId(service) {
|
function getOperatorId(service) {
|
||||||
const sql = `SELECT operator_id FROM operator_ids WHERE service = '${service}'`
|
const sql = 'SELECT operator_id FROM operator_ids WHERE service = ${service}'
|
||||||
return db.oneOrNone(sql).then(_.get('operator_id'))
|
return db.oneOrNone(sql, { service }).then(_.get('operator_id'))
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = { getOperatorId }
|
module.exports = { getOperatorId }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue