MCPcopy Create free account
hub / github.com/RealDevSquad/website-backend / fetchIssues

Function fetchIssues

services/githubService.js:236–261  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

234 * Fetches issues across all repositories in the ORG
235 */
236const fetchIssues = async () => {
237 try {
238 const baseURL = config.get("githubApi.baseUrl");
239 const issues = "/issues";
240 const urlObj = new URL(baseURL);
241 urlObj.pathname = "orgs" + "/" + config.get("githubApi.org") + issues;
242 const createdURL = urlObj.href;
243 const res = await getFetchWithAuthToken(
244 createdURL,
245 {
246 filter: "all",
247 state: "open",
248 },
249 {
250 Accept: "application/vnd.github+json",
251 // TODO: replace <AUTH-TOKEN> with RDS org PAT
252 Authorization: `Bearer <AUTH-TOKEN>`,
253 org: config.get("githubApi.org"),
254 }
255 );
256 return res;
257 } catch (err) {
258 logger.error(`Error while fetching issues: ${err}`);
259 throw err;
260 }
261};
262
263/**
264 * Fetches issues for given repository and id

Callers

nothing calls this directly

Calls 2

getFetchWithAuthTokenFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected