Skip to content

Commit

Permalink
Showing only projects with mantainer permissions at least
Browse files Browse the repository at this point in the history
  • Loading branch information
pinarruiz committed May 31, 2024
1 parent aa33443 commit 738a2b3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib/gitlab/projects.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import { SimpleProjectSchema } from "@gitbeaker/rest";
import { AccessLevel, SimpleProjectSchema } from "@gitbeaker/rest";
import { GITLAB_PER_PAGE } from "@/lib/appEnv";
import { getApiObject } from "@/lib/gitlab/utils";

export async function queryProjects(oauthToken: string, page: number = 1) {
export async function queryProjects(
oauthToken: string,
page: number = 1,
minAccessLevel: number = AccessLevel.MAINTAINER,
) {
return await getApiObject(oauthToken).Projects.all({
pagination: "offset",
showExpanded: true,
page: page,
simple: true,
perPage: GITLAB_PER_PAGE,
minAccessLevel: minAccessLevel,
});
}

Expand Down

0 comments on commit 738a2b3

Please sign in to comment.