Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function enable (params) {
const [drainId] = params.args;
const { alias } = params.options;
const { app_id: appId } = await AppConfig.getAppData(alias).toPromise();
await updateDrainState({ appId, drainId }, { state: 'ENABLED' }).then(sendToApi);
Logger.println('Your drain has been enabled');
}
async function disable (params) {
const [drainId] = params.args;
const { alias } = params.options;
const { app_id: appId } = await AppConfig.getAppData(alias).toPromise();
await updateDrainState({ appId, drainId }, { state: 'DISABLED' }).then(sendToApi);
Logger.println('Your drain has been disabled');
}