chore: template attachments

This commit is contained in:
Catalin Pit
2025-07-07 13:31:55 +03:00
parent 30b240cba2
commit e19da93ce2
19 changed files with 583 additions and 195 deletions

View File

@ -0,0 +1,28 @@
import { prisma } from '@documenso/prisma';
import { buildTeamWhereQuery } from '../../utils/teams';
export type FindTemplateAttachmentsOptions = {
templateId: number;
userId: number;
teamId: number;
};
export const findTemplateAttachments = async ({
templateId,
userId,
teamId,
}: FindTemplateAttachmentsOptions) => {
const attachments = await prisma.attachment.findMany({
where: {
template: {
id: templateId,
team: buildTeamWhereQuery({ teamId, userId }),
},
},
});
console.log('attachments', attachments);
return attachments;
};