mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 16:51:38 +10:00
chore: revert changes based on feedback
This commit is contained in:
22
packages/lib/server-only/attachment/find-attachments.ts
Normal file
22
packages/lib/server-only/attachment/find-attachments.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import { prisma } from '@documenso/prisma';
|
||||
|
||||
import { buildTeamWhereQuery } from '../../utils/teams';
|
||||
|
||||
export type FindAttachmentsOptions = {
|
||||
documentId: number;
|
||||
userId: number;
|
||||
teamId: number;
|
||||
};
|
||||
|
||||
export const findAttachments = async ({ documentId, userId, teamId }: FindAttachmentsOptions) => {
|
||||
const attachments = await prisma.attachment.findMany({
|
||||
where: {
|
||||
document: {
|
||||
id: documentId,
|
||||
team: buildTeamWhereQuery({ teamId, userId }),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return attachments;
|
||||
};
|
||||
Reference in New Issue
Block a user