Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const createDashboard = async(name, orgId) => {
const dbdsAPI = new DashboardsAPI(new InfluxDB({url: __config.influx_url, token: __defaultUser.token, timeout: 20000}));
await dbdsAPI.postDashboards({body: {name: name, orgID: orgId}}).catch(async error => {
console.log('--- Error Creating dashboard ---');
console.error(error);
throw error;
});
};
const getDashboards = async(userName) => {
let user = getUser(userName);
const dbdsAPI = new DashboardsAPI(new InfluxDB({url: __config.influx_url, token: user.token, timeout: 20000}));
return await dbdsAPI.getDashboards();
};