Handle issues paging
This commit is contained in:
@ -5,9 +5,18 @@ import { gitea } from '../../util/gitea';
|
||||
export function* fetchIssuesSaga(action) {
|
||||
const { project } = action;
|
||||
|
||||
let issues;
|
||||
let issues = [];
|
||||
try {
|
||||
issues = yield call(gitea.fetchIssues.bind(gitea), action.project);
|
||||
let page = 1;
|
||||
while(true) {
|
||||
let pageIssues = yield call(gitea.fetchIssues.bind(gitea), action.project, page);
|
||||
if (pageIssues.length === 0) {
|
||||
break;
|
||||
}
|
||||
issues.push(...pageIssues);
|
||||
page++;
|
||||
}
|
||||
|
||||
} catch(error) {
|
||||
yield put({ type: FETCH_ISSUES_FAILURE, project, error });
|
||||
return;
|
||||
|
Reference in New Issue
Block a user