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

Method fetchEmails

app/src/lib/api.ts:1081–1091  ·  view source on GitHub ↗

Fetch the current user's emails.

()

Source from the content-addressed store, hash-verified

1079
1080 /** Fetch the current user's emails. */
1081 public async fetchEmails(): Promise<ReadonlyArray<IAPIEmail>> {
1082 try {
1083 const response = await this.ghRequest('GET', 'user/emails')
1084 const result = await parsedResponse<ReadonlyArray<IAPIEmail>>(response)
1085
1086 return Array.isArray(result) ? result : []
1087 } catch (e) {
1088 log.warn(`fetchEmails: failed with endpoint ${this.endpoint}`, e)
1089 return []
1090 }
1091 }
1092
1093 /** Fetch all the orgs to which the user belongs. */
1094 public async fetchOrgs(): Promise<ReadonlyArray<IAPIOrganization>> {

Callers 1

fetchUserFunction · 0.95

Calls 2

ghRequestMethod · 0.95
warnMethod · 0.80

Tested by

no test coverage detected