Get all issues the authenticated user has access to. By default it returns only issues created by the current user.
1
import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
2
/*
3
@param: {wmill.Resource<"gitlab">} glab - Resource containing Gitlab Auth API Key
4
Example:
5
{
6
auth: gitlab_api_key
7
}
8
*/
9
export async function main(
10
glab: wmill.Resource<"gitlab">,
11
projectId: number,
12
) {
13
const url = `https://gitlab.com/api/v4/projects/${projectId}/issues`;
14
const issue = await fetch(`${url}`, {
15
headers: { "Authorization": `Bearer: ${glab.token}` },
16
});
17
return await issue.json();
18
19