0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Updated validation for post/page

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

- ignores `tiers` as its a valid visibility filter
This commit is contained in:
Rishabh 2022-01-26 16:52:10 +05:30 committed by Rishabh Garg
parent bc5c00ba05
commit d461525978
2 changed files with 2 additions and 2 deletions

View file

@ -16,7 +16,7 @@ const validateVisibility = async function (frame) {
const visibility = frame.data.pages[0].visibility;
const visibilityFilter = frame.data.pages[0].visibility_filter;
if (visibility) {
if (!['public', 'members', 'paid'].includes(visibility)) {
if (!['public', 'members', 'paid', 'tiers'].includes(visibility)) {
// check filter is valid
try {
await models.Member.findPage({filter: visibilityFilter, limit: 1});

View file

@ -16,7 +16,7 @@ const validateVisibility = async function (frame) {
const visibility = frame.data.posts[0].visibility;
const visibilityFilter = frame.data.posts[0].visibility_filter;
if (visibility) {
if (!['public', 'members', 'paid'].includes(visibility)) {
if (!['public', 'members', 'paid', 'tiers'].includes(visibility)) {
// check filter is valid
try {
await models.Member.findPage({filter: visibilityFilter, limit: 1});