Add optional topTeams parameter for getAllTeams method, defaults to 100 which is default in azure-devops-node-api
Signed-off-by: Quadman <QuadmanSWE@gmail.com>
This commit is contained in:
@@ -66,7 +66,7 @@ export interface AzureDevOpsApi {
|
||||
projectName: string,
|
||||
): Promise<DashboardPullRequest[]>;
|
||||
|
||||
getAllTeams(): Promise<Team[]>;
|
||||
getAllTeams(topTeams?: number): Promise<Team[]>;
|
||||
|
||||
getUserTeamIds(userId: string): Promise<string[]>;
|
||||
|
||||
|
||||
@@ -130,8 +130,16 @@ export class AzureDevOpsClient implements AzureDevOpsApi {
|
||||
);
|
||||
}
|
||||
|
||||
public getAllTeams(): Promise<Team[]> {
|
||||
return this.get<Team[]>('all-teams');
|
||||
public getAllTeams(topTeams?: number): Promise<Team[]> {
|
||||
const queryString = new URLSearchParams();
|
||||
if (topTeams) {
|
||||
queryString.append('topTeams', topTeams.toString());
|
||||
}
|
||||
let urlSegment = 'all-teams';
|
||||
if (queryString.toString()) {
|
||||
urlSegment += `?${queryString}`;
|
||||
}
|
||||
return this.get<Team[]>(urlSegment);
|
||||
}
|
||||
|
||||
public getUserTeamIds(userId: string): Promise<string[]> {
|
||||
|
||||
Reference in New Issue
Block a user