fix(backend-github): loaded entries limit (#2873)
* fix(backend-github): loaded entries limit * test(cypress): update recorded data
This commit is contained in:
parent
f3eaaa6432
commit
68a8c8a693
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -331,16 +331,16 @@ export default class API {
|
|||||||
}
|
}
|
||||||
|
|
||||||
listFiles(path, { repoURL = this.repoURL, branch = this.branch } = {}) {
|
listFiles(path, { repoURL = this.repoURL, branch = this.branch } = {}) {
|
||||||
return this.request(`${repoURL}/contents/${path.replace(/\/$/, '')}`, {
|
const folderPath = path.replace(/\/$/, '');
|
||||||
params: { ref: branch },
|
return this.request(`${repoURL}/git/trees/${branch}:${folderPath}`).then(res =>
|
||||||
})
|
res.tree
|
||||||
.then(files => {
|
.filter(file => file.type === 'blob')
|
||||||
if (!Array.isArray(files)) {
|
.map(file => ({
|
||||||
throw new Error(`Cannot list files, path ${path} is not a directory but a ${files.type}`);
|
...file,
|
||||||
}
|
name: file.path,
|
||||||
return files;
|
path: `${folderPath}/${file.path}`,
|
||||||
})
|
})),
|
||||||
.then(files => files.filter(file => file.type === 'file'));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
readUnpublishedBranchFile(contentKey) {
|
readUnpublishedBranchFile(contentKey) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user