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