chore: enable prefetch

This commit is contained in:
iCrawl
2023-11-13 11:07:47 +01:00
parent 978a39f6d3
commit 356cadb382
8 changed files with 8 additions and 26 deletions

View File

@@ -16,26 +16,14 @@ export const fetchMember = cache(async (packageName: string, branchName: string,
const model = new ApiModel();
if (branchName === 'main') {
const modelJSONFiles = await Promise.all(PACKAGES.map(async (pkg) => fetchModelJSON(pkg, branchName)));
const modelJSON = await fetchModelJSON(packageName, branchName);
for (const modelJSONFile of modelJSONFiles) {
if (!modelJSONFile) {
continue;
}
addPackageToModel(model, modelJSONFile);
}
} else {
const modelJSON = await fetchModelJSON(packageName, branchName);
if (!modelJSON) {
return null;
}
addPackageToModel(model, modelJSON);
if (!modelJSON) {
return null;
}
addPackageToModel(model, modelJSON);
const [memberName, overloadIndex] = decodeURIComponent(item).split(OVERLOAD_SEPARATOR);
// eslint-disable-next-line prefer-const