made the teams limit option available in front end but with no defined default value since it is set to a default 100 in backend
Signed-off-by: Quadman <QuadmanSWE@gmail.com>
This commit is contained in:
@@ -178,6 +178,9 @@ export async function createRouter(
|
||||
const { projectName, repoName } = req.params;
|
||||
|
||||
const top = req.query.top ? Number(req.query.top) : DEFAULT_TOP;
|
||||
const teamsLimit = req.query.teamsLimit
|
||||
? Number(req.query.teamsLimit)
|
||||
: DEFAULT_TEAMS_LIMIT;
|
||||
const host = req.query.host?.toString();
|
||||
const org = req.query.org?.toString();
|
||||
const status = req.query.status
|
||||
@@ -187,6 +190,7 @@ export async function createRouter(
|
||||
const pullRequestOptions: PullRequestOptions = {
|
||||
top: top,
|
||||
status: status,
|
||||
teamsLimit: teamsLimit,
|
||||
};
|
||||
|
||||
const entityRef = req.query.entityRef;
|
||||
|
||||
@@ -107,6 +107,9 @@ export class AzureDevOpsClient implements AzureDevOpsApi {
|
||||
if (options?.status) {
|
||||
queryString.append('status', options.status.toString());
|
||||
}
|
||||
if (options?.teamsLimit) {
|
||||
queryString.append('teamsLimit', options.teamsLimit.toString());
|
||||
}
|
||||
if (host) {
|
||||
queryString.append('host', host);
|
||||
}
|
||||
|
||||
@@ -31,16 +31,19 @@ export function usePullRequests(
|
||||
entity: Entity,
|
||||
defaultLimit?: number,
|
||||
requestedStatus?: PullRequestStatus,
|
||||
defaultTeamsLimit?: number,
|
||||
): {
|
||||
items?: PullRequest[];
|
||||
loading: boolean;
|
||||
error?: Error;
|
||||
} {
|
||||
const top = defaultLimit ?? AZURE_DEVOPS_DEFAULT_TOP;
|
||||
const teamsLimit = defaultTeamsLimit ?? undefined;
|
||||
const status = requestedStatus ?? PullRequestStatus.Active;
|
||||
const options: PullRequestOptions = {
|
||||
top,
|
||||
status,
|
||||
teamsLimit,
|
||||
};
|
||||
|
||||
const api = useApi(azureDevOpsApiRef);
|
||||
|
||||
Reference in New Issue
Block a user