Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix: correctly filter prompt on production promotion (#1899)

Max Deichmanndd4a92f9d8c1
diff --git a/web/src/features/prompts/server/prompt-router.ts b/web/src/features/prompts/server/prompt-router.ts
index 9aa359cc2e..cc6fe63c00 100644
--- a/web/src/features/prompts/server/prompt-router.ts
+++ b/web/src/features/prompts/server/prompt-router.ts
@@ -328,6 +328,7 @@ export const promptRouter = createTRPCRouter({
const toBePromotedPrompt = await ctx.prisma.prompt.findUniqueOrThrow({
where: {
id: input.promptId,
+ projectId: input.projectId,
},
});
@@ -358,6 +359,7 @@ export const promptRouter = createTRPCRouter({
ctx.prisma.prompt.update({
where: {
id: toBePromotedPrompt.id,
+ projectId: input.projectId,
},
data: {
isActive: true,
@@ -369,6 +371,7 @@ export const promptRouter = createTRPCRouter({
ctx.prisma.prompt.update({
where: {
id: latestActivePrompt.id,
+ projectId: input.projectId,
},
data: {
isActive: false,