Skip to content

Commit

Permalink
remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kabeaty committed Jun 21, 2024
1 parent 00ea92e commit 0a6ef1b
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions server/src/core/server/models/story/story.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1038,20 +1038,16 @@ export async function retrieveStoryCommentCounts(
tenantID: string,
storyID: string
) {
const cursor = mongo
.comments()
// .aggregate([{ $match: { tenantID, storyID } }, { $count: "count " }]);
.aggregate([
{
$match: {
tenantID,
storyID,
status: { $in: [GQLCOMMENT_STATUS.APPROVED, GQLCOMMENT_STATUS.NONE] },
},
const cursor = mongo.comments().aggregate([
{
$match: {
tenantID,
storyID,
status: { $in: [GQLCOMMENT_STATUS.APPROVED, GQLCOMMENT_STATUS.NONE] },
},
{ $count: "count" },
]);
// test out filtering non-published statuses here vs filtering after the fact
},
{ $count: "count" },
]);

const hasNext = await cursor.hasNext();
if (!hasNext) {
Expand Down

0 comments on commit 0a6ef1b

Please sign in to comment.