2023-08-10 17:07:09 +00:00
|
|
|
import { prisma } from "@calcom/prisma";
|
2023-09-14 16:53:58 +00:00
|
|
|
import { credentialForCalendarServiceSelect } from "@calcom/prisma/selects/credential";
|
2023-08-10 17:07:09 +00:00
|
|
|
|
|
|
|
export async function getUsersCredentials(userId: number) {
|
|
|
|
const credentials = await prisma.credential.findMany({
|
|
|
|
where: {
|
|
|
|
userId,
|
|
|
|
},
|
2023-09-14 16:53:58 +00:00
|
|
|
select: credentialForCalendarServiceSelect,
|
2023-08-10 17:07:09 +00:00
|
|
|
orderBy: {
|
|
|
|
id: "asc",
|
|
|
|
},
|
|
|
|
});
|
|
|
|
return credentials;
|
|
|
|
}
|