mirror of
https://github.com/prdlk/leetcode.git
synced 2026-11-02 13:12:44 +00:00
feat(api): expose review markdown body in Review objects
This commit is contained in:
1 parent
d722feda1c
commit
ffa8a11f51
1 file changed
+6
-2
@@ -13,7 +13,7 @@
|
|||||||
* layer, the way apps/cli already imports srs.ts.
|
* layer, the way apps/cli already imports srs.ts.
|
||||||
*
|
*
|
||||||
* Library: side-effect-free on import; the caller passes its GitHub client —
|
* Library: side-effect-free on import; the caller passes its GitHub client —
|
||||||
* the Worker's or the CLI's, which share the three members used here.
|
* the Worker's or the CLI's, which share the two members used here.
|
||||||
*/
|
*/
|
||||||
import type { GitHub } from "./github.ts";
|
import type { GitHub } from "./github.ts";
|
||||||
|
|
||||||
@@ -35,6 +35,8 @@ export interface Review {
|
|||||||
number: number;
|
number: number;
|
||||||
title: string;
|
title: string;
|
||||||
open: boolean;
|
open: boolean;
|
||||||
|
/** Markdown body: `**Scheduled:**` / `**Phase:**` / `**Load:**` lines the release reads. */
|
||||||
|
body: string;
|
||||||
/** Sub-issues in the order GitHub lists them (the solve order). */
|
/** Sub-issues in the order GitHub lists them (the solve order). */
|
||||||
problems: (Problem & { fromTopic: number | null })[];
|
problems: (Problem & { fromTopic: number | null })[];
|
||||||
}
|
}
|
||||||
@@ -58,7 +60,7 @@ export async function readReviews(gh: Pick<GitHub, "repo" | "graphql">): Promise
|
|||||||
issues(labels: ["review"], first: 50, after: $after, orderBy: { field: CREATED_AT, direction: ASC }) {
|
issues(labels: ["review"], first: 50, after: $after, orderBy: { field: CREATED_AT, direction: ASC }) {
|
||||||
pageInfo { hasNextPage endCursor }
|
pageInfo { hasNextPage endCursor }
|
||||||
nodes {
|
nodes {
|
||||||
number title state
|
number title state body
|
||||||
subIssues(first: 50) {
|
subIssues(first: 50) {
|
||||||
pageInfo { hasNextPage }
|
pageInfo { hasNextPage }
|
||||||
nodes {
|
nodes {
|
||||||
@@ -82,6 +84,7 @@ export async function readReviews(gh: Pick<GitHub, "repo" | "graphql">): Promise
|
|||||||
number: number;
|
number: number;
|
||||||
title: string;
|
title: string;
|
||||||
state: "OPEN" | "CLOSED";
|
state: "OPEN" | "CLOSED";
|
||||||
|
body: string;
|
||||||
subIssues: {
|
subIssues: {
|
||||||
pageInfo: { hasNextPage: boolean };
|
pageInfo: { hasNextPage: boolean };
|
||||||
nodes: {
|
nodes: {
|
||||||
@@ -106,6 +109,7 @@ export async function readReviews(gh: Pick<GitHub, "repo" | "graphql">): Promise
|
|||||||
number: issue.number,
|
number: issue.number,
|
||||||
title: issue.title,
|
title: issue.title,
|
||||||
open: issue.state === "OPEN",
|
open: issue.state === "OPEN",
|
||||||
|
body: issue.body,
|
||||||
problems: issue.subIssues.nodes.map((p) => ({
|
problems: issue.subIssues.nodes.map((p) => ({
|
||||||
number: p.number,
|
number: p.number,
|
||||||
title: p.title,
|
title: p.title,
|
||||||
|
|||||||
Reference in new issue
Block a user