MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / getFirstAndLastMessages

Function getFirstAndLastMessages

apps/web/services/threads/metrics.ts:14–30  ·  view source on GitHub ↗
(
  threadId: string,
  messageId: string
)

Source from the content-addressed store, hash-verified

12}
13
14export async function getFirstAndLastMessages(
15 threadId: string,
16 messageId: string
17) {
18 return await Promise.all([
19 prisma.messages.findFirst({
20 where: { threads: { id: threadId } },
21 take: 1,
22 orderBy: { sentAt: 'asc' },
23 select: { author: true },
24 }),
25 prisma.messages.findFirst({
26 where: { id: messageId },
27 select: { author: true, sentAt: true },
28 }),
29 ]);
30}
31
32export function isReplierMember(
33 thread: {

Callers 1

updateMetricsMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected