mirror of
https://github.com/wassname/talk.git
synced 2026-07-13 17:45:56 +08:00
[CORL-836] Create activeStories endpoint (#2787)
* Create activeStories GraphQL query endpoint Set lastCommentedAt on stories when they are commented upon. Use lastCommentedAt to retrieve the activeStories. Create a migration to partial index lastCommentedAt on stories to make retrieval fast. CORL-836 * fix: adjusted query to use index, more @auth directives Co-authored-by: Wyatt Johnson <accounts+github@wyattjoh.ca>
This commit is contained in:
@@ -25,7 +25,10 @@ import {
|
||||
hasAncestors,
|
||||
hasPublishedStatus,
|
||||
} from "coral-server/models/comment/helpers";
|
||||
import { retrieveStory } from "coral-server/models/story";
|
||||
import {
|
||||
retrieveStory,
|
||||
updateStoryLastCommentedAt,
|
||||
} from "coral-server/models/story";
|
||||
import { Tenant } from "coral-server/models/tenant";
|
||||
import { User } from "coral-server/models/user";
|
||||
import {
|
||||
@@ -174,7 +177,10 @@ export default async function create(
|
||||
now
|
||||
);
|
||||
|
||||
await updateUserLastCommentID(redis, tenant, author, comment.id);
|
||||
await Promise.all([
|
||||
updateUserLastCommentID(redis, tenant, author, comment.id),
|
||||
updateStoryLastCommentedAt(mongo, tenant.id, story.id, now),
|
||||
]);
|
||||
|
||||
// Pull the revision out.
|
||||
const revision = getLatestRevision(comment);
|
||||
|
||||
Reference in New Issue
Block a user