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

Method findBy

apps/web/services/threads/index.ts:284–306  ·  view source on GitHub ↗
({
    externalThreadId,
    channelId,
    threadId,
  }: threadFindType)

Source from the content-addressed store, hash-verified

282 }
283
284 static async findBy({
285 externalThreadId,
286 channelId,
287 threadId,
288 }: threadFindType): Promise<threadFindResponseType> {
289 return await prisma.threads.findFirst({
290 select: {
291 id: true,
292 title: true,
293 externalThreadId: true,
294 channelId: true,
295 messages: {
296 select: {
297 body: true,
298 author: { select: { displayName: true, profileImageUrl: true } },
299 },
300 orderBy: { sentAt: 'asc' },
301 take: 1,
302 },
303 },
304 where: { channelId, OR: [{ externalThreadId }, { id: threadId }] },
305 });
306 }
307}
308
309export default ThreadsServices;

Callers 2

findMethod · 0.80
putMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected