mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -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 = {
|
||||
find: {
|
||||
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: {
|
||||
limit: 10
|
||||
|
|
|
@ -90,7 +90,10 @@ viewParameters.pending = function (terms) {
|
|||
return {
|
||||
find: {
|
||||
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}}
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue