add missing apps.delPortBinding

this got lost in async/db translation
This commit is contained in:
Girish Ramakrishnan
2021-09-17 09:52:18 -07:00
parent c5794b5ecd
commit 2554c47632

View File

@@ -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');