Fetch the current user's emails.
()
| 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>> { |