Compare commits

..

No commits in common. "14151e48419dac4dad7b2932333391fa33c7bfa5" and "07a5a3447608a5e58c03a42e222588c778a9858b" 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())