84bc330fa8
* feat: rename repository files to include Repository suffix - Rename apiKey.ts to apiKeyRepository.ts - Rename assignmentReason.ts to assignmentReasonRepository.ts - Update all import statements to use new file names Co-Authored-By: eunjae@cal.com <hey@eunjae.dev> * feat: rename repository files to PrismaRepository with Prisma prefix - Rename apiKeyRepository.ts to PrismaApiKeyRepository.ts - Rename assignmentReasonRepository.ts to PrismaAssignmentReasonRepository.ts - Update class names to PrismaApiKeyRepository and PrismaAssignmentReasonRepository - Update all import statements and usages across 3 files Co-Authored-By: eunjae@cal.com <hey@eunjae.dev> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
23 lines
446 B
TypeScript
23 lines
446 B
TypeScript
import prisma from "@calcom/prisma";
|
|
|
|
export class PrismaApiKeyRepository {
|
|
static async findApiKeysFromUserId({ userId }: { userId: number }) {
|
|
return await prisma.apiKey.findMany({
|
|
where: {
|
|
userId,
|
|
OR: [
|
|
{
|
|
NOT: {
|
|
appId: "zapier",
|
|
},
|
|
},
|
|
{
|
|
appId: null,
|
|
},
|
|
],
|
|
},
|
|
orderBy: { createdAt: "desc" },
|
|
});
|
|
}
|
|
}
|