Compare commits

..

No commits in common. "0af54a0d5245c901ef1e9811cb59d09fdeedc1bb" and "6bb8afd91498ad4f7860c2d780a3afe2783bc6db" have entirely different histories.

2 changed files with 5 additions and 13 deletions

View File

@ -3,18 +3,10 @@ import { FETCH_PROJECTS_SUCCESS, FETCH_PROJECTS_FAILURE } from '../actions/proje
import { gitea } from '../../util/gitea';
export function* fetchProjectsSaga() {
let projects = [];
let projects;
try {
let page = 1;
while(true) {
let pageProjects = yield call(gitea.fetchUserProjects.bind(gitea), page);
if (pageProjects.length === 0) {
break;
}
projects.push(...pageProjects);
page++;
}
projects = yield call(gitea.fetchUserProjects.bind(gitea))
} catch(error) {
yield put({ type: FETCH_PROJECTS_FAILURE, error });
return;

View File

@ -16,8 +16,8 @@ export class GiteaClient {
;
}
fetchUserProjects(page = 1) {
return fetch(`/gitea/api/v1/user/repos?page=${page}`)
fetchUserProjects() {
return fetch(`/gitea/api/v1/user/repos`)
.then(this.assertAuthorization)
.then(this.assertOk)
.then(res => res.json())