Fix broken v1 homepage api

Due to 88740082
This commit is contained in:
infinite-persistence 2022-05-13 20:48:34 +08:00
parent f79f346c94
commit e0fee8cb25
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -10,7 +10,16 @@ if (!memo.homepageData) {
} }
const getHomepageJsonV1 = () => { const getHomepageJsonV1 = () => {
return memo.homepageData || {}; if (!memo.homepageData) {
return {};
}
const v1 = {};
const homepageKeys = Object.keys(memo.homepageData);
homepageKeys.forEach((hp) => {
v1[hp] = memo.homepageData[hp].categories;
});
return v1;
}; };
const getHomepageJsonV2 = () => { const getHomepageJsonV2 = () => {