From 1a55a2a9b38b2aa39c38623908cb60e01b6c028e Mon Sep 17 00:00:00 2001 From: firelemons Date: Fri, 4 Feb 2022 17:21:06 -0600 Subject: [PATCH] change output to list of strings --- index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index f819789..4e6a9a1 100644 --- a/index.js +++ b/index.js @@ -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 @@ -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