Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⭐FEAT: Make the issues list dynamic #242

Open
ThGnommy opened this issue Jun 12, 2023 · 2 comments
Open

⭐FEAT: Make the issues list dynamic #242

ThGnommy opened this issue Jun 12, 2023 · 2 comments

Comments

@ThGnommy
Copy link
Contributor

Would be nice to have a dynamic issues list.

image

We can use the Octokit API to handle all the requests for the issues.
I think since this will be a major change for the project is better to have a discussion first, I have already start working on this.

This is a code example for the API request using octokit, with pagination.

const octokit = new Octokit({
  auth: import.meta.env.VITE_GITHUB_TOKEN,
});

export const getRepoInfo = async () => {
  try {
    const parameters = {
      owner: "ArslanYM",
      repo: "StarterHive",
      sort: "updated",
      direction: "asc",
      per_page: 6,
    };

    const issuesPages = [];

    for await (const response of octokit.paginate.iterator(
      "GET /repos/{owner}/{repo}/issues",
      parameters
    )) {
      const issues = response.data;
      issuesPages.push(issues);
    }
    // This function returns an array that contains different arrays with a max of 6 issue objects. 
    // This way we can handle the pagination easily.
    return issuesPages;
  } catch (error) {
    throw new Error(error);
  }
};
@welcome
Copy link

welcome bot commented Jun 12, 2023

💖Thanks for opening your first issue here! Be sure to star ⭐ the repo !💖

@ArslanYM
Copy link
Owner

@ThGnommy Actually we will be soon working on this, The Find Issues section is supposed to show issues in projects or codebases of organizations that are actual companies. And can potentially hire people.

ThGnommy added a commit to ThGnommy/StarterHive that referenced this issue Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants