* Replace ctx.user.credentials to fetch in their own usecases * Remove rawavatar from return * Remove avatar rawAvatar from handler * Fix fallback avatars * fix: profile.slug already includes /team * perf: Deprecate useAvatarQuery hook * Extract to reusable credential func * Fix type errors for credentials * credentialOwner was inferred incorrectly, string non-nullable --------- Co-authored-by: Keith Williams <keithwillcode@gmail.com> Co-authored-by: Alex van Andel <me@alexvanandel.com>
23 lines
414 B
TypeScript
23 lines
414 B
TypeScript
import { prisma } from "@calcom/prisma";
|
|
|
|
export async function getUsersCredentials(userId: number) {
|
|
const credentials = await prisma.credential.findMany({
|
|
where: {
|
|
userId,
|
|
},
|
|
select: {
|
|
id: true,
|
|
type: true,
|
|
key: true,
|
|
userId: true,
|
|
appId: true,
|
|
invalid: true,
|
|
teamId: true,
|
|
},
|
|
orderBy: {
|
|
id: "asc",
|
|
},
|
|
});
|
|
return credentials;
|
|
}
|