fix query to list API keys (#2690)

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Carina Wollendorfer 2022-05-06 16:48:27 +02:00 committed by GitHub
parent 65a76b96c6
commit 83ec6d69eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,10 +11,17 @@ export const apiKeysRouter = createProtectedRouter()
return await ctx.prisma.apiKey.findMany({ return await ctx.prisma.apiKey.findMany({
where: { where: {
userId: ctx.user.id, userId: ctx.user.id,
OR: [
{
NOT: { NOT: {
appId: "zapier", appId: "zapier",
}, },
}, },
{
appId: null,
},
],
},
orderBy: { createdAt: "desc" }, orderBy: { createdAt: "desc" },
}); });
}, },