Skip to content

Commit

Permalink
Merge pull request #10 from metalabdesign/fetch-id
Browse files Browse the repository at this point in the history
Fetch revisions by id if available
  • Loading branch information
disusered committed Feb 24, 2017
2 parents a0717b6 + a03e46c commit 2adc6df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions public/app/features/audit/audit_srv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import {DashboardModel} from '../dashboard/model';

export class AuditSrv {
/** @ngInject */
constructor(private backendSrv) {}
constructor(private backendSrv, private $q) {}

getAuditLog(dashboard: DashboardModel) {
return this.backendSrv.get(`api/dashboards/db/${dashboard.meta.slug}/versions`);
const url = `api/dashboards/db/${dashboard.id}/versions`;
return dashboard.id ? this.backendSrv.get(url) : this.$q.when([]);
}
}

Expand Down

0 comments on commit 2adc6df

Please sign in to comment.