Removed usage of portal products setting

refs https://github.com/TryGhost/Team/issues/1387

Tier visibility is now managed by `visibility` property, and we'll be removing the `portal_products` setting in future.
This commit is contained in:
Rishabh 2022-03-08 15:49:59 +05:30
parent 45a6286a64
commit 12944a4c91

View File

@ -285,15 +285,10 @@ export default ModalComponent.extend({
},
updateAllowedProduct(productId, isChecked) {
const portalProductsSetting = this.settings.get('portalProducts') || [];
const allowedProducts = [...portalProductsSetting];
const product = this.model.products.find(p => p.id === productId);
if (!isChecked) {
this.settings.set('portalProducts', allowedProducts.filter(p => p !== productId));
product.set('visibility', 'none');
} else {
this.settings.set('portalProducts', allowedProducts);
product.set('visibility', 'public');
}
let portalProducts = this.model.products.filter((p) => {