Update project-bot-fns.ts

This commit is contained in:
Daniel Hougaard
2024-05-23 15:48:54 +02:00
parent 68d1849ba0
commit 6230167794
@@ -20,10 +20,7 @@ export const getBotKeyFnFactory = (
) => { ) => {
const getBotKeyFn = async (projectId: string) => { const getBotKeyFn = async (projectId: string) => {
const project = await projectDAL.findById(projectId); const project = await projectDAL.findById(projectId);
if (!project) if (!project) throw new BadRequestError({ message: "Project not found during bot lookup." });
throw new BadRequestError({
message: "Project not found during bot lookup."
});
const bot = await projectBotDAL.findOne({ projectId: project.id }); const bot = await projectBotDAL.findOne({ projectId: project.id });