Skip to content

Commit 8279e6b

Browse files
authored
Merge pull request kriskbx#10 from leschekfm/docs_fix
Docs fix for usage as lib example
2 parents 9a1cbb8 + 170e639 commit 8279e6b

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

readme.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ Use it in your project:
686686
```js
687687
// require modules
688688
const Config = require('gitlab-time-tracker/include/config');
689-
const Report = require('gitlab-time-tracker/model/report');
689+
const Report = require('gitlab-time-tracker/models/report');
690690
691691
// create a default config
692692
let config = new Config();
@@ -698,12 +698,16 @@ config.set('project', 'namespace/project');
698698
// create report
699699
let report = new Report(config);
700700
701-
// chain promises to query and process data
702-
report.project()
703-
.then(report.issues, error => {})
704-
.then(report.mergeRequests, error => {})
705-
.then(report.processIssues, error => {})
706-
.then(report.processMergeRequests, error => {});
701+
// query and process data
702+
try {
703+
await report.getProject()
704+
await report.getIssues()
705+
await report.getMergeRequests()
706+
await report.processIssues()
707+
await report.processMergeRequests()
708+
} catch (error) {
709+
console.log(error)
710+
}
707711
708712
// access data on report
709713
report.issues.forEach(issue => {

0 commit comments

Comments
 (0)