Compare commits
No commits in common. "0af54a0d5245c901ef1e9811cb59d09fdeedc1bb" and "6bb8afd91498ad4f7860c2d780a3afe2783bc6db" have entirely different histories.
0af54a0d52
...
6bb8afd914
@ -3,18 +3,10 @@ import { FETCH_PROJECTS_SUCCESS, FETCH_PROJECTS_FAILURE } from '../actions/proje
|
||||
import { gitea } from '../../util/gitea';
|
||||
|
||||
export function* fetchProjectsSaga() {
|
||||
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++;
|
||||
}
|
||||
|
||||
let projects;
|
||||
try {
|
||||
projects = yield call(gitea.fetchUserProjects.bind(gitea))
|
||||
} catch(error) {
|
||||
yield put({ type: FETCH_PROJECTS_FAILURE, error });
|
||||
return;
|
||||
|
@ -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())
|
||||
|
Loading…
x
Reference in New Issue
Block a user