fix: resolve issue with uploading templates

This commit is contained in:
Mythie
2025-05-03 07:38:48 +10:00
parent 8c9dd5e372
commit 0931c472a7

View File

@ -44,7 +44,8 @@ export const createTemplate = async ({
} }
} }
const folder = await prisma.folder.findFirstOrThrow({ if (folderId) {
const folder = await prisma.folder.findFirst({
where: { where: {
id: folderId, id: folderId,
...(teamId ...(teamId
@ -65,6 +66,13 @@ export const createTemplate = async ({
}, },
}); });
if (!folder) {
throw new AppError(AppErrorCode.NOT_FOUND, {
message: 'Folder not found',
});
}
}
if (!team) { if (!team) {
throw new AppError(AppErrorCode.NOT_FOUND); throw new AppError(AppErrorCode.NOT_FOUND);
} }