Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fetchRepos = () => {
- apiGithubappReposList()
- .then((GHrepos) => {
- const apiGHRepos =
- // @ts-ignore The endpoint to get the Github repos is wrongly typed
- GHrepos.results?.map((repo: any) => {
- return {
- repo: `${repo}`,
- type: "github",
- };
- }) ?? [];
- setRepos([...apiGHRepos]);
- return apiGHRepos;
- })
- .then((apiGHRepos) => {
- apiGitlabappReposList().then((GLrepos) => {
- const apiGLRepos =
- // @ts-ignore The endpoint to get the Gitlab repos is wrongly typed
- GLrepos.results?.map((repo: any) => {
- return {
- repo: `${repo}`,
- type: "gitlab",
- };
- }) ?? [];
- setRepos([...apiGHRepos, ...apiGLRepos]);
- });
- })
- .then(() => {
- setReposFirstLoading(false);
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement