mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 16:51:38 +10:00
chore: merged main
This commit is contained in:
@ -6,9 +6,15 @@ export type GetTemplateByIdOptions = {
|
||||
id: number;
|
||||
userId: number;
|
||||
teamId?: number;
|
||||
folderId?: string | null;
|
||||
};
|
||||
|
||||
export const getTemplateById = async ({ id, userId, teamId }: GetTemplateByIdOptions) => {
|
||||
export const getTemplateById = async ({
|
||||
id,
|
||||
userId,
|
||||
teamId,
|
||||
folderId = null,
|
||||
}: GetTemplateByIdOptions) => {
|
||||
const template = await prisma.template.findFirst({
|
||||
where: {
|
||||
id,
|
||||
@ -27,6 +33,7 @@ export const getTemplateById = async ({ id, userId, teamId }: GetTemplateByIdOpt
|
||||
userId,
|
||||
teamId: null,
|
||||
}),
|
||||
...(folderId ? { folderId } : {}),
|
||||
},
|
||||
include: {
|
||||
directLink: true,
|
||||
@ -42,6 +49,7 @@ export const getTemplateById = async ({ id, userId, teamId }: GetTemplateByIdOpt
|
||||
email: true,
|
||||
},
|
||||
},
|
||||
folder: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user