mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 04:22:32 +10:00
20 lines
365 B
TypeScript
20 lines
365 B
TypeScript
import { prisma } from '@documenso/prisma';
|
|
|
|
export const getWebhooksByTeamId = async (teamId: number, userId: number) => {
|
|
return await prisma.webhook.findMany({
|
|
where: {
|
|
team: {
|
|
id: teamId,
|
|
members: {
|
|
some: {
|
|
userId,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
orderBy: {
|
|
createdAt: 'desc',
|
|
},
|
|
});
|
|
};
|