fix(githubUtils): show number, not id in github autocomplete

This commit is contained in:
xHyroM 2022-08-28 15:36:04 +02:00
parent c81ca4c8c1
commit 80d8b6c470

View file

@ -197,7 +197,7 @@ export const search = async(query: string, repository: string, state: IssueState
if (!query) {
const array = arrayFiltered.slice(0, 25);
return array.map((issueOrPr: Issue | PullRequest) => new Object({
name: `${issueOrPr.type.slice(-1)}${issueOrPr.id}) ${formatEmojiStatus(issueOrPr)} ${issueOrPr.title.slice(0, 93 - issueOrPr.id.toString().length).replace(githubTitleClean, '')}`,
name: `${issueOrPr.type.slice(0, -1)}${issueOrPr.number}) ${formatEmojiStatus(issueOrPr)} ${issueOrPr.title.slice(0, 93 - issueOrPr.id.toString().length).replace(githubTitleClean, '')}`,
value: issueOrPr.number.toString()
})) as APIApplicationCommandOptionChoice[]
}