chore: revert changes based on feedback

This commit is contained in:
Catalin Pit
2025-07-07 12:04:20 +03:00
parent 52b474d12b
commit eb78706f35
9 changed files with 154 additions and 107 deletions

View 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;
};