Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (const dashboard of bundle.dashboards) {
- const p = getDashboard(dashboard._id).then(d => {
- if (d) {
- if (item.replace === true) {
- return replace.push(d);
- }
- messages.push('Dashboard was not imported because it already exists in database: ' + d.dashboardName);
- return;
- }
- return importDashboard(dashboard, datasourceRef).then(d => {
- additions.push(d);
- });
- });
- promises.push(p);
- }
- return $q.all(promises).then(() => {
- return {
- additions: additions,
- messages: messages,
- replace: replace,
- };
- });
- this.replaceDashboard = function () {
- var params = {
- fields: ['_id', 'name']
- };
- return connection.post('/api/dashboardsv2/update/:id', params).then(d => d.item);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement