StarterHive
StarterHive copied to clipboard
⭐FEAT: Make the issues list dynamic
Would be nice to have a dynamic issues list.
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);
}
};
💖Thanks for opening your first issue here! Be sure to star ⭐ the repo !💖
@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.