0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

🐛 Fixed failing update-check job

refs https://github.com/TryGhost/Toolbox/issues/525
refs https://github.com/TryGhost/Ghost/pull/16224

- The update check job has been failing due to uninitialized Members Service. Loading Tiers in the context of update check is not important because all we are looking for is the posts count.
- The products repository list service is also about to be replace by Tiers repository, so getting correctly initialized members service is not crucial.
This commit is contained in:
Naz 2023-02-27 15:58:00 +08:00
parent 6afcf8eec8
commit 81f8abdbd6
No known key found for this signature in database

View file

@ -12,10 +12,10 @@ module.exports = {
} }
let posts = []; let posts = [];
const tiersModels = await membersService.api.productRepository.list({ const tiersModels = await membersService.api?.productRepository.list({
limit: 'all' limit: 'all'
}); });
const tiers = tiersModels.data ? tiersModels.data.map(tierModel => tierModel.toJSON()) : []; const tiers = tiersModels?.data ? tiersModels.data.map(tierModel => tierModel.toJSON()) : [];
if (models.meta) { if (models.meta) {
for (let model of models.data) { for (let model of models.data) {
let post = await mappers.posts(model, frame, {tiers}); let post = await mappers.posts(model, frame, {tiers});