Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const createVariable = async(userName, name, type, values, selected = null ) => {
let user = getUser(userName);
let varAPI = new VariablesAPI(new InfluxDB({url: __config.influx_url, token: user.token, timeout: 20000}));
let parseValues = JSON.parse(values);
let reSel = selected === null ? selected : JSON.parse(selected);
return await varAPI.postVariables({body: {name: name,
orgID: user.orgid,
arguments: {
type: type,
values: parseValues
},
selected: reSel
}
})
};