push
This commit is contained in:
@@ -241,7 +241,7 @@ async function update(req, res) {
|
||||
let checkSql = 'SELECT id, employee_id FROM contracts WHERE id = ?'
|
||||
let checkParams = [id]
|
||||
if (req.scope && req.scope.sql) {
|
||||
checkSql += ' ' + req.scope.sql
|
||||
checkSql += ' ' + req.scope.sql.replace(/\btype\b/g, 'c.type')
|
||||
checkParams.push(...req.scope.params)
|
||||
}
|
||||
const [existing] = await pool.query(checkSql, checkParams)
|
||||
@@ -320,7 +320,7 @@ async function remove(req, res) {
|
||||
let checkSql = 'SELECT id FROM contracts WHERE id = ?'
|
||||
let checkParams = [id]
|
||||
if (req.scope && req.scope.sql) {
|
||||
checkSql += ' ' + req.scope.sql
|
||||
checkSql += ' ' + req.scope.sql.replace(/\btype\b/g, 'c.type')
|
||||
checkParams.push(...req.scope.params)
|
||||
}
|
||||
const [existing] = await pool.query(checkSql, checkParams)
|
||||
|
||||
Reference in New Issue
Block a user