3 var cacheWrapper
= require('gitter-web-cache-wrapper');
4 var IssuableService
= require('./issuable-service');
5 var getGitlabAccessTokenFromUser
= require('./get-gitlab-access-token-from-user');
7 function GitLabIssuableStateService(user
, type
) {
8 this.type
= type
|| 'issues';
9 this.issuableService
= new IssuableService(user
, this.type
);
10 this.getAccessTokenPromise
= getGitlabAccessTokenFromUser(user
);
13 GitLabIssuableStateService
.prototype.getIssueState = function(project
, iid
) {
14 return this.issuableService
.getIssue(project
, iid
).then(function(issuable
) {
15 return issuable
.state
;
19 module
.exports
= cacheWrapper('GitLabIssuableStateService', GitLabIssuableStateService
, {
20 getInstanceId: function(gitLabIssuableStateService
) {
21 return gitLabIssuableStateService
.getAccessTokenPromise
;