getLabels description

This commit is contained in:
Jordi Montes 2018-01-22 17:23:35 +01:00
parent e29c5c1675
commit 5df7da3fa2
1 changed files with 2 additions and 1 deletions

View File

@ -3,7 +3,7 @@
const https = require('https'); const https = require('https');
const config = require('../config'); const config = require('../config');
// Returns the url for getting the labels of a request (Github v3) // Returns the url for getting the labels of a request (Github API v3)
// req has req.issue.labels_url // req has req.issue.labels_url
const getLabelsURL = function(req) { const getLabelsURL = function(req) {
let url = req.issue.labels_url; let url = req.issue.labels_url;
@ -11,6 +11,7 @@ const getLabelsURL = function(req) {
return url.replace('{/name}', ''); return url.replace('{/name}', '');
} }
// Returns all labelNames of a given issue (Github API v3)
const getLabels = function(req) { const getLabels = function(req) {
let url = getLabelsURL(req); let url = getLabelsURL(req);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {