From 9e2aaccaddb175be0f29672adce3eb574db2d5ca Mon Sep 17 00:00:00 2001 From: Brad White Date: Wed, 13 Nov 2024 20:49:26 -0700 Subject: [PATCH] add missing fields to serverless pr --- src/common/github-service.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/common/github-service.ts b/src/common/github-service.ts index cbd7143..51cc3b1 100644 --- a/src/common/github-service.ts +++ b/src/common/github-service.ts @@ -19,7 +19,10 @@ type Progress = export type PrItem = Endpoints['GET /search/issues']['response']['data']['items'][number]; export type Label = PrItem['labels'][number]; -export type ServerlessPrItem = Pick; +export type ServerlessPrItem = Pick< + PullRequest, + 'id' | 'url' | 'title' | 'number' | 'body' | 'labels' | 'author' +>; interface GitHubServiceConfig { octokit: Octokit; @@ -305,10 +308,14 @@ class GitHubService { ... on Commit { associatedPullRequests(first: 10) { nodes { + id url title number body + author { + login + } labels(first: 50) { nodes { name @@ -354,6 +361,16 @@ class GitHubService { } }); }); + + return pullRequests.map((pr) => { + return { + ...pr, + // @ts-expect-error sadasd + labels: pr.labels.nodes, + user: pr.author, + html_url: pr.url, + }; + }); } }