fix: getIssue

This commit is contained in:
元凛
2022-02-10 13:47:52 +08:00
parent 7833b3db99
commit c6a0bf65a1
2 changed files with 2 additions and 4 deletions

3
dist/index.js vendored
View File

@@ -15673,7 +15673,7 @@ class IssueCoreEngine {
repo, repo,
issue_number: issueNumber, issue_number: issueNumber,
}); });
return issue.data; return issue;
}); });
} }
getUserPermission(username) { getUserPermission(username) {
@@ -15756,7 +15756,6 @@ class IssueCoreEngine {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const { owner, repo, octokit, issueNumber, getIssue } = this; const { owner, repo, octokit, issueNumber, getIssue } = this;
const issue = yield getIssue(); const issue = yield getIssue();
console.log(issue);
const baseLabels = issue.labels.map(({ name }) => name); const baseLabels = issue.labels.map(({ name }) => name);
const removeLabels = baseLabels.filter(name => labels.includes(name)); const removeLabels = baseLabels.filter(name => labels.includes(name));
for (const label of removeLabels) { for (const label of removeLabels) {

View File

@@ -136,7 +136,7 @@ export class IssueCoreEngine implements IIssueCoreEngine {
repo, repo,
issue_number: issueNumber, issue_number: issueNumber,
}); });
return issue.data as TIssueInfo; return issue as unknown as TIssueInfo;
} }
public async getUserPermission(username: string) { public async getUserPermission(username: string) {
@@ -217,7 +217,6 @@ export class IssueCoreEngine implements IIssueCoreEngine {
public async removeLabels(labels: string[]) { public async removeLabels(labels: string[]) {
const { owner, repo, octokit, issueNumber, getIssue } = this; const { owner, repo, octokit, issueNumber, getIssue } = this;
const issue = await getIssue(); const issue = await getIssue();
console.log(issue)
const baseLabels: string[] = issue.labels.map(({ name }) => name); const baseLabels: string[] = issue.labels.map(({ name }) => name);
const removeLabels = baseLabels.filter(name => labels.includes(name)); const removeLabels = baseLabels.filter(name => labels.includes(name));