({
where,
orderBy,
take,
}: Prisma.threadsFindManyArgs)
| 43 | } |
| 44 | |
| 45 | export async function queryThreads({ |
| 46 | where, |
| 47 | orderBy, |
| 48 | take, |
| 49 | }: Prisma.threadsFindManyArgs) { |
| 50 | return await prisma.threads.findMany({ |
| 51 | include: { |
| 52 | messages: { |
| 53 | include: { |
| 54 | author: true, |
| 55 | mentions: { |
| 56 | include: { |
| 57 | users: true, |
| 58 | }, |
| 59 | }, |
| 60 | reactions: true, |
| 61 | attachments: true, |
| 62 | }, |
| 63 | orderBy: { sentAt: 'asc' }, |
| 64 | }, |
| 65 | channel: { |
| 66 | include: { |
| 67 | memberships: { |
| 68 | select: { |
| 69 | usersId: true, |
| 70 | user: { select: { authsId: true } }, |
| 71 | }, |
| 72 | }, |
| 73 | }, |
| 74 | }, |
| 75 | }, |
| 76 | where, |
| 77 | orderBy, |
| 78 | take, |
| 79 | }); |
| 80 | } |
| 81 | |
| 82 | export function threadsWhere({ accountId }: { accountId: string }) { |
| 83 | return { |
no outgoing calls
no test coverage detected