MCPcopy Create free account
hub / github.com/desktop/desktop / fetchIssueComment

Method fetchIssueComment

app/src/lib/api.ts:909–933  ·  view source on GitHub ↗

* Fetch an issue comment (i.e. a comment on an issue or pull request). * * @param owner The owner of the repository * @param name The name of the repository * @param commentId The ID of the comment * * @returns The comment if it was found, null if it wasn't, or an error * occurr

(
    owner: string,
    name: string,
    commentId: string
  )

Source from the content-addressed store, hash-verified

907 * occurred.
908 */
909 public async fetchIssueComment(
910 owner: string,
911 name: string,
912 commentId: string
913 ): Promise<IAPIComment | null> {
914 try {
915 const response = await this.ghRequest(
916 'GET',
917 `repos/${owner}/${name}/issues/comments/${commentId}`
918 )
919 if (response.status === HttpStatusCode.NotFound) {
920 log.warn(
921 `fetchIssueComment: '${owner}/${name}/issues/comments/${commentId}' returned a 404`
922 )
923 return null
924 }
925 return await parsedResponse<IAPIComment>(response)
926 } catch (e) {
927 log.warn(
928 `fetchIssueComment: an error occurred for '${owner}/${name}/issues/comments/${commentId}'`,
929 e
930 )
931 return null
932 }
933 }
934
935 /**
936 * Fetch a pull request review comment (i.e. a comment that was posted as part

Callers 1

Calls 2

ghRequestMethod · 0.95
warnMethod · 0.80

Tested by

no test coverage detected