(accountId: string, userId: string)
| 244 | } |
| 245 | |
| 246 | async function createChannelMemberships(accountId: string, userId: string) { |
| 247 | const channels = await prisma.channels.findMany({ |
| 248 | where: { |
| 249 | accountId: accountId, |
| 250 | default: true, |
| 251 | }, |
| 252 | }); |
| 253 | await prisma.memberships.createMany({ |
| 254 | skipDuplicates: true, |
| 255 | data: channels.map((c) => ({ |
| 256 | channelsId: c.id, |
| 257 | usersId: userId, |
| 258 | })), |
| 259 | }); |
| 260 | } |
| 261 | |
| 262 | export async function joinCommunity( |
| 263 | email: string, |
no test coverage detected