From 143aa005aeb9ed031dba864ca263481578656287 Mon Sep 17 00:00:00 2001 From: Sag Date: Wed, 6 Mar 2024 10:05:01 +0100 Subject: [PATCH] Updated logic for bulkEdit: clean silently, rather than throw an error --- ghost/posts-service/lib/PostsService.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghost/posts-service/lib/PostsService.js b/ghost/posts-service/lib/PostsService.js index e36ac1cf45b3..cab2dfffe0bf 100644 --- a/ghost/posts-service/lib/PostsService.js +++ b/ghost/posts-service/lib/PostsService.js @@ -271,12 +271,12 @@ class PostsService { } let tiers = undefined; if (data.meta.visibility === 'tiers') { - if (!Array.isArray(data.meta.tiers) || data.meta.tiers.some(tier => tier.type === 'free')) { + if (!Array.isArray(data.meta.tiers)) { throw new errors.IncorrectUsageError({ message: tpl(messages.invalidTiers) }); } - tiers = data.meta.tiers; + tiers = data.meta.tiers.filter(t => t.type === 'paid'); } return await this.#updatePosts({visibility: data.meta.visibility, tiers}, {filter: options.filter, context: options.context}); }