Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const createLabel = async(userName,
labelName,
labelDescr,
labelColor ) =>{
let user = getUser(userName);
const lblAPI = new LabelsAPI(new InfluxDB({url: __config.influx_url, token: user.token, timeout: 20000}));
let lblCreateReq = {body: {name: labelName, orgID: user.orgid,
properties: { description: labelDescr, color: labelColor }}};
await lblAPI.postLabels(lblCreateReq).catch(async error => {
console.log('--- Error Creating label ---');
console.error(error);
throw error;
});
};