({
isAdmin = false,
isBot = false,
anonymousAlias = generateRandomWordSlug(),
...user
}: {
externalUserId: string;
accountsId: string;
isAdmin?: boolean;
isBot?: boolean;
displayName: string;
anonymousAlias?: string;
profileImageUrl?: string;
role?: Roles;
})
| 116 | }); |
| 117 | } |
| 118 | static async upsertUser({ |
| 119 | isAdmin = false, |
| 120 | isBot = false, |
| 121 | anonymousAlias = generateRandomWordSlug(), |
| 122 | ...user |
| 123 | }: { |
| 124 | externalUserId: string; |
| 125 | accountsId: string; |
| 126 | isAdmin?: boolean; |
| 127 | isBot?: boolean; |
| 128 | displayName: string; |
| 129 | anonymousAlias?: string; |
| 130 | profileImageUrl?: string; |
| 131 | role?: Roles; |
| 132 | }) { |
| 133 | return prisma.users.upsert({ |
| 134 | create: { |
| 135 | ...user, |
| 136 | isAdmin, |
| 137 | isBot, |
| 138 | anonymousAlias, |
| 139 | }, |
| 140 | update: { |
| 141 | displayName: user.displayName, |
| 142 | profileImageUrl: user.profileImageUrl, |
| 143 | }, |
| 144 | where: { |
| 145 | externalUserId_accountsId: { |
| 146 | accountsId: user.accountsId, |
| 147 | externalUserId: user.externalUserId!, |
| 148 | }, |
| 149 | }, |
| 150 | }); |
| 151 | } |
| 152 | static async findUsersByExternalId({ |
| 153 | accountId, |
| 154 | externalIds, |
no test coverage detected