feat: Created PullRequestsDashboardProvider for resolving team and team member relations

Signed-off-by: Marley Powell <Marley.Powell@exclaimer.com>
This commit is contained in:
Marley Powell
2021-12-16 14:35:21 +00:00
parent 9c2e6bb86a
commit 060a39e4d8
7 changed files with 191 additions and 19 deletions
@@ -49,4 +49,6 @@ export interface AzureDevOpsApi {
): Promise<DashboardPullRequest[]>;
getAllTeams(): Promise<Team[]>;
getUserTeamIds(userId: string): Promise<string[]>;
}
@@ -88,6 +88,10 @@ export class AzureDevOpsClient implements AzureDevOpsApi {
return this.get<Team[]>('all-teams');
}
public getUserTeamIds(userId: string): Promise<string[]> {
return this.get<string[]>(`users/${userId}/team-ids`);
}
private async get<T>(path: string): Promise<T> {
const baseUrl = `${await this.discoveryApi.getBaseUrl('azure-devops')}/`;
const url = new URL(path, baseUrl);