Fix suggestions for issues (#32380)
This commit is contained in:
parent
f4d3aaeeb9
commit
a4a121c684
11 changed files with 82 additions and 88 deletions
|
@ -1,6 +1,6 @@
|
|||
import emojis from '../../../assets/emoji.json';
|
||||
import type {Issue} from '../features/issue.ts';
|
||||
import {GET} from '../modules/fetch.ts';
|
||||
import type {Issue} from '../features/issue.ts';
|
||||
|
||||
const maxMatches = 6;
|
||||
|
||||
|
@ -49,8 +49,8 @@ export async function matchIssue(owner: string, repo: string, issueIndexStr: str
|
|||
const res = await GET(`${window.config.appSubUrl}/${owner}/${repo}/issues/suggestions?q=${encodeURIComponent(query)}`);
|
||||
|
||||
const issues: Issue[] = await res.json();
|
||||
const issueIndex = parseInt(issueIndexStr);
|
||||
const issueNumber = parseInt(issueIndexStr);
|
||||
|
||||
// filter out issue with same id
|
||||
return issues.filter((i) => i.id !== issueIndex);
|
||||
return issues.filter((i) => i.number !== issueNumber);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue