Function
findThreadsByChannel
({
channelId,
cursor,
limit = 10,
}: {
channelId: string;
cursor?: number;
limit?: number;
})
Source from the content-addressed store, hash-verified
| 440 | } |
| 441 | |
| 442 | export const findThreadsByChannel = ({ |
| 443 | channelId, |
| 444 | cursor, |
| 445 | limit = 10, |
| 446 | }: { |
| 447 | channelId: string; |
| 448 | cursor?: number; |
| 449 | limit?: number; |
| 450 | }) => { |
| 451 | return prisma.threads.findMany({ |
| 452 | where: { |
| 453 | channelId, |
| 454 | sentAt: { gt: cursor || 0 }, |
| 455 | hidden: false, |
| 456 | messageCount: { gt: 1 }, |
| 457 | }, |
| 458 | take: limit, |
| 459 | orderBy: { sentAt: 'asc' }, |
| 460 | }); |
| 461 | }; |
| 462 | |
| 463 | export async function findPinnedThreads({ |
| 464 | channelIds, |
Tested by
no test coverage detected