mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Fixed tiers paywall selecting all paid tiers (#19817)
refs INC-36
- oversight in parent commit 00cff0a
This commit is contained in:
parent
00cff0aece
commit
656846018a
1 changed files with 5 additions and 1 deletions
|
@ -62,10 +62,14 @@ module.exports = async (model, frame, options = {}) => {
|
|||
jsonModel.tiers = tiersData || [];
|
||||
}
|
||||
|
||||
if (['tiers', 'paid'].includes(jsonModel.visibility) && jsonModel.tiers) {
|
||||
if (jsonModel.visibility === 'paid' && jsonModel.tiers) {
|
||||
jsonModel.tiers = tiersData ? tiersData.filter(t => t.type === 'paid') : [];
|
||||
}
|
||||
|
||||
if (jsonModel.visibility === 'tiers' && Array.isArray(jsonModel.tiers)) {
|
||||
jsonModel.tiers = jsonModel.tiers.filter(t => t.type === 'paid');
|
||||
}
|
||||
|
||||
if (!['members', 'public', 'paid', 'tiers'].includes(jsonModel.visibility)) {
|
||||
const tiers = await postsService.getProductsFromVisibilityFilter(jsonModel.visibility);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue