({
accountId,
authId,
displayName,
profileImageUrl,
}: {
accountId: string;
authId: string;
displayName: string;
profileImageUrl?: string;
})
| 276 | } |
| 277 | |
| 278 | async function createUser({ |
| 279 | accountId, |
| 280 | authId, |
| 281 | displayName, |
| 282 | profileImageUrl, |
| 283 | }: { |
| 284 | accountId: string; |
| 285 | authId: string; |
| 286 | displayName: string; |
| 287 | profileImageUrl?: string; |
| 288 | }) { |
| 289 | const user = await prisma.users.create({ |
| 290 | data: { |
| 291 | isAdmin: false, |
| 292 | isBot: false, |
| 293 | accountsId: accountId, |
| 294 | authsId: authId, |
| 295 | displayName, |
| 296 | anonymousAlias: generateRandomWordSlug(), |
| 297 | role: Roles.MEMBER, |
| 298 | profileImageUrl, |
| 299 | }, |
| 300 | }); |
| 301 | await eventUserJoin({ userId: user.id }); |
| 302 | return user; |
| 303 | } |
| 304 | |
| 305 | async function findUser(accountId: string, authId: string) { |
| 306 | return await prisma.users.findFirst({ |
no test coverage detected