add missing apps.delPortBinding
this got lost in async/db translation
This commit is contained in:
@@ -10,6 +10,7 @@ exports = module.exports = {
|
||||
update,
|
||||
setHealth,
|
||||
del,
|
||||
delPortBinding,
|
||||
|
||||
get,
|
||||
getByIpAddress,
|
||||
@@ -817,6 +818,14 @@ async function del(id) {
|
||||
if (results[5].affectedRows !== 1) throw new BoxError(BoxError.NOT_FOUND, 'App not found');
|
||||
}
|
||||
|
||||
async function delPortBinding(hostPort, type) {
|
||||
assert.strictEqual(typeof hostPort, 'number');
|
||||
assert.strictEqual(typeof type, 'string');
|
||||
|
||||
const result = await database.query('DELETE FROM appPortBindings WHERE hostPort=? AND type=?', [ hostPort, type ]);
|
||||
if (result.affectedRows !== 1) throw new BoxError(BoxError.NOT_FOUND, 'App not found');
|
||||
}
|
||||
|
||||
async function clear() {
|
||||
await database.query('DELETE FROM subdomains');
|
||||
await database.query('DELETE FROM appPortBindings');
|
||||
|
||||
Reference in New Issue
Block a user