Skip to content

Commit

Permalink
Updated logic for bulkEdit: clean silently, rather than throw an error
Browse files Browse the repository at this point in the history
  • Loading branch information
sagzy committed Mar 6, 2024
1 parent 29ea3ae commit 143aa00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ghost/posts-service/lib/PostsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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});
}
Expand Down

0 comments on commit 143aa00

Please sign in to comment.