forked from kriskbx/gitlab-time-tracker
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathissue.js
More file actions
22 lines (17 loc) · 729 Bytes
/
Copy pathissue.js
File metadata and controls
22 lines (17 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import CoreTask from './task.js';
import GitlabClient from './gitlab-client.js';
class Issue extends CoreTask {
static resoureType = 'issues';
constructor(config, data, client) {
super(config, data, client, Issue.resoureType);
}
static list(config, project, state, my, client = new GitlabClient(config)) {
const query = `scope=${my ? "assigned-to-me" : "all"}&state=${state}`;
const path = project
? `projects/${encodeURIComponent(project)}/${Issue.resoureType}?${query}`
: `${Issue.resoureType}/?${query}`;
return client.get(path)
.then(response => response.body.map(data => new this(config, data, client)));
}
}
export default Issue;