Skip to content

Commit

Permalink
change output to list of strings
Browse files Browse the repository at this point in the history
  • Loading branch information
FireLemons committed Feb 4, 2022
1 parent e8f5936 commit 1a55a2a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ async function getColumnCardIssues (columnId) {
// Get a list of labels for an issue
// @param {number} issueNumber The number of the issue to fetch labels for
// @return {Promise} A promise representing fetching of the labels for an issue
// @fulfilled {Object} A list of objects each representing a label
// @fulfilled {Array} An array of label strings
// @throws {TypeError} for a parameter of the incorrect type
// @throws {RangeError} when issueNumber is less than 1
// @throws {Error} if an error occurs while trying to fetch the project data
Expand All @@ -155,11 +155,13 @@ async function getIssueLabels (issueNumber) {
throw new TypeError('Param issueNumber must be an integer')
}

return await octokit.request('GET /repos/{owner}/{repo}/issues/{issue_number}/labels', {
const labelObjectList = await octokit.request('GET /repos/{owner}/{repo}/issues/{issue_number}/labels', {
owner: owner,
repo: repo,
issue_number: issueNumber
})
}).data

return labelObjectList.map((labelObject) => labelObject.name)
}

// Get the project with name passed into projectName from the current repo
Expand Down

0 comments on commit 1a55a2a

Please sign in to comment.