mirror of
https://github.com/vale981/Vulcan
synced 2025-03-08 19:11:38 -05:00
fix pending view bug by including posts without a postedAt property as well
This commit is contained in:
parent
2def10822a
commit
242bf4e783
2 changed files with 8 additions and 2 deletions
|
@ -10,7 +10,10 @@ getPostsParameters = function (terms) {
|
||||||
var baseParameters = {
|
var baseParameters = {
|
||||||
find: {
|
find: {
|
||||||
status: STATUS_APPROVED,
|
status: STATUS_APPROVED,
|
||||||
postedAt: {$lte: new Date()} // only show posts in the past
|
$or: [
|
||||||
|
{postedAt: {$lte: new Date()}}, // only show posts if they're in the past
|
||||||
|
{postedAt: {$exists: false}} // or if they don't have a "postedAt" date (i.e. pending posts)
|
||||||
|
]
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
limit: 10
|
limit: 10
|
||||||
|
|
|
@ -90,7 +90,10 @@ viewParameters.pending = function (terms) {
|
||||||
return {
|
return {
|
||||||
find: {
|
find: {
|
||||||
status: 1,
|
status: 1,
|
||||||
postedAt: {$lte: new Date("December 31, 2999")} // for pending view, show future posts too
|
$or: [
|
||||||
|
{postedAt: {$lte: new Date("December 31, 2999")}},
|
||||||
|
{postedAt: {$exists: false}}
|
||||||
|
] // for pending view, show future posts too
|
||||||
},
|
},
|
||||||
options: {sort: {createdAt: -1}}
|
options: {sort: {createdAt: -1}}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue