Skip to content

Commit 5dc9907

Browse files
committed
[Regenerate] Add method: getIssueComments
1 parent b3d6d2e commit 5dc9907

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

Issue.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// @flow
2+
3+
import { request, required } from './Client'
4+
5+
// flow types
6+
import type { FetchOptions } from './Client';
7+
import type {
8+
CommentEntity,
9+
} from './definitions';
10+
11+
type getIssueCommentsParams = {
12+
}
13+
14+
export function getIssueComments(
15+
owner: string = required("owner"),
16+
repo: string = required("repo"),
17+
number: number = required("number"),
18+
params: getIssueCommentsParams,
19+
options?: FetchOptions
20+
): Promise<Array<CommentEntity>> {
21+
return request(`/repos/${owner}/${repo}/issues/${number}/comments`, params, "GET", options);
22+
}

definitions.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ export type NotificationEntity = {
3535
last_read_at: string,
3636
}
3737

38+
export type CommentEntity = {
39+
id: string,
40+
body: string,
41+
user: UserEntity,
42+
created_at: string,
43+
updated_at: string,
44+
}
45+
3846
export type IssueEntity = {
3947
id: number,
4048
number: number,

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
export * from './Client';
44
export * from './Auth';
55
export * from './Repository';
6+
export * from './Issue';
67
export * from './Search';
78
export * from './Notifications.js';
89
export * from './GitHub';

0 commit comments

Comments
 (0)